Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -171,8 +171,23 @@ def create_demo(model_name: str, device: str = "cuda:0" if torch.cuda.is_availab
|
|
| 171 |
is_schnell = model_name == "flux-schnell"
|
| 172 |
|
| 173 |
with gr.Blocks() as demo:
|
| 174 |
-
gr.Markdown(f"#
|
|
|
|
|
|
|
|
|
|
| 175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
with gr.Row():
|
| 177 |
with gr.Column():
|
| 178 |
source_prompt = gr.Textbox(label="Source Prompt", value="")
|
|
@@ -200,8 +215,8 @@ def create_demo(model_name: str, device: str = "cuda:0" if torch.cuda.is_availab
|
|
| 200 |
|
| 201 |
with gr.Column():
|
| 202 |
with gr.Accordion("Advanced Options", open=True):
|
| 203 |
-
num_steps = gr.Slider(1, 30, 25, step=1, label="
|
| 204 |
-
inject_step = gr.Slider(1, 15, 3, step=1, label="
|
| 205 |
guidance = gr.Slider(1.0, 10.0, 2, step=0.1, label="Guidance", interactive=not is_schnell)
|
| 206 |
# seed = gr.Textbox(0, label="Seed (-1 for random)", visible=False)
|
| 207 |
# add_sampling_metadata = gr.Checkbox(label="Add sampling parameters to metadata?", value=False)
|
|
|
|
| 171 |
is_schnell = model_name == "flux-schnell"
|
| 172 |
|
| 173 |
with gr.Blocks() as demo:
|
| 174 |
+
# gr.Markdown(f"# Official Demo for Taming Rectified Flow for Inversion and Editing")
|
| 175 |
+
title = r"""
|
| 176 |
+
<h1 align="center">Taming Rectified Flow for Inversion and Editing</h1>
|
| 177 |
+
"""
|
| 178 |
|
| 179 |
+
description = r"""
|
| 180 |
+
<b>Official 🤗 Gradio demo</b> for <a href='https://github.com/wangjiangshan0725/RF-Solver-Edit' target='_blank'><b>Taming Rectified Flow for Inversion and Editing</b></a>.<br>
|
| 181 |
+
|
| 182 |
+
❗️❗️❗️[<b>Important</b>] Editing steps:<br>
|
| 183 |
+
1️⃣ Upload images you want to edit (The resolution is expected be less than 1360*768, or the memory of GPU may be not enough.)
|
| 184 |
+
2️⃣ Enter the source prompt, which describes the content of the image you unload. The source prompt is not mandatory; you can also leave it to null.
|
| 185 |
+
3️⃣ Enter the target prompt which describes the content of the expected images after editing.
|
| 186 |
+
4️⃣ Click the <b>Generate</b> button to start customizing.
|
| 187 |
+
5️⃣ We suggest to adjust the value of **feature sharing steps** for better results.
|
| 188 |
+
"""
|
| 189 |
+
gr.Markdown(title)
|
| 190 |
+
gr.Markdown(description)
|
| 191 |
with gr.Row():
|
| 192 |
with gr.Column():
|
| 193 |
source_prompt = gr.Textbox(label="Source Prompt", value="")
|
|
|
|
| 215 |
|
| 216 |
with gr.Column():
|
| 217 |
with gr.Accordion("Advanced Options", open=True):
|
| 218 |
+
num_steps = gr.Slider(1, 30, 25, step=1, label="Total timesteps")
|
| 219 |
+
inject_step = gr.Slider(1, 15, 3, step=1, label="Feature sharing steps")
|
| 220 |
guidance = gr.Slider(1.0, 10.0, 2, step=0.1, label="Guidance", interactive=not is_schnell)
|
| 221 |
# seed = gr.Textbox(0, label="Seed (-1 for random)", visible=False)
|
| 222 |
# add_sampling_metadata = gr.Checkbox(label="Add sampling parameters to metadata?", value=False)
|