Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,57 +52,56 @@ with gr.Blocks(title="FLUX SRPO Text-to-Image", theme=gr.themes.Soft(primary_hue
|
|
| 52 |
gr.Markdown("Generate images using FLUX model enhanced with Tencent's SRPO technique")
|
| 53 |
gr.Markdown("Built with [AnyCoder](https://huggingface.co/spaces/akhaliq/anycoder)")
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
)
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
step=64,
|
| 69 |
-
label="Width"
|
| 70 |
-
)
|
| 71 |
-
height = gr.Slider(
|
| 72 |
-
minimum=256,
|
| 73 |
-
maximum=2048,
|
| 74 |
-
value=1024,
|
| 75 |
-
step=64,
|
| 76 |
-
label="Height"
|
| 77 |
-
)
|
| 78 |
-
|
| 79 |
-
with gr.Row():
|
| 80 |
-
guidance_scale = gr.Slider(
|
| 81 |
-
minimum=1.0,
|
| 82 |
-
maximum=20.0,
|
| 83 |
-
value=3.5,
|
| 84 |
-
step=0.5,
|
| 85 |
-
label="Guidance Scale"
|
| 86 |
-
)
|
| 87 |
-
num_inference_steps = gr.Slider(
|
| 88 |
-
minimum=10,
|
| 89 |
-
maximum=100,
|
| 90 |
-
value=50,
|
| 91 |
-
step=5,
|
| 92 |
-
label="Inference Steps"
|
| 93 |
-
)
|
| 94 |
-
|
| 95 |
-
seed = gr.Number(
|
| 96 |
-
label="Seed (-1 for random)",
|
| 97 |
-
value=-1,
|
| 98 |
-
precision=0
|
| 99 |
)
|
| 100 |
-
|
| 101 |
-
generate_btn = gr.Button("Generate Image", variant="primary", size="lg")
|
| 102 |
|
| 103 |
-
with gr.
|
| 104 |
-
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
gr.Examples(
|
| 108 |
examples=[
|
|
|
|
| 52 |
gr.Markdown("Generate images using FLUX model enhanced with Tencent's SRPO technique")
|
| 53 |
gr.Markdown("Built with [AnyCoder](https://huggingface.co/spaces/akhaliq/anycoder)")
|
| 54 |
|
| 55 |
+
output_image = gr.Image(label="Generated Image", type="pil")
|
| 56 |
+
|
| 57 |
+
prompt = gr.Textbox(
|
| 58 |
+
label="Prompt",
|
| 59 |
+
placeholder="Describe the image you want to generate...",
|
| 60 |
+
lines=3
|
| 61 |
+
)
|
| 62 |
+
|
| 63 |
+
generate_btn = gr.Button("Generate Image", variant="primary", size="lg")
|
| 64 |
+
|
| 65 |
+
with gr.Accordion("Advanced Settings", open=False):
|
| 66 |
+
with gr.Row():
|
| 67 |
+
width = gr.Slider(
|
| 68 |
+
minimum=256,
|
| 69 |
+
maximum=2048,
|
| 70 |
+
value=1024,
|
| 71 |
+
step=64,
|
| 72 |
+
label="Width"
|
| 73 |
)
|
| 74 |
+
height = gr.Slider(
|
| 75 |
+
minimum=256,
|
| 76 |
+
maximum=2048,
|
| 77 |
+
value=1024,
|
| 78 |
+
step=64,
|
| 79 |
+
label="Height"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
)
|
|
|
|
|
|
|
| 81 |
|
| 82 |
+
with gr.Row():
|
| 83 |
+
guidance_scale = gr.Slider(
|
| 84 |
+
minimum=1.0,
|
| 85 |
+
maximum=20.0,
|
| 86 |
+
value=3.5,
|
| 87 |
+
step=0.5,
|
| 88 |
+
label="Guidance Scale"
|
| 89 |
+
)
|
| 90 |
+
num_inference_steps = gr.Slider(
|
| 91 |
+
minimum=10,
|
| 92 |
+
maximum=100,
|
| 93 |
+
value=50,
|
| 94 |
+
step=5,
|
| 95 |
+
label="Inference Steps"
|
| 96 |
+
)
|
| 97 |
+
|
| 98 |
+
seed = gr.Number(
|
| 99 |
+
label="Seed (-1 for random)",
|
| 100 |
+
value=-1,
|
| 101 |
+
precision=0
|
| 102 |
+
)
|
| 103 |
+
|
| 104 |
+
used_seed = gr.Number(label="Seed Used", precision=0)
|
| 105 |
|
| 106 |
gr.Examples(
|
| 107 |
examples=[
|