Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -170,13 +170,7 @@ with gr.Blocks(css=css, theme=steel_blue_theme) as demo:
|
|
| 170 |
|
| 171 |
with gr.Row(equal_height=True):
|
| 172 |
with gr.Column():
|
| 173 |
-
input_image = gr.Image(label="Upload Image", type="pil"
|
| 174 |
-
|
| 175 |
-
lora_adapter = gr.Dropdown(
|
| 176 |
-
label="Choose Editing Style",
|
| 177 |
-
choices=["Photo-to-Anime", "Multiple-Angles", "Light-Restoration", "Relight"],
|
| 178 |
-
value="Photo-to-Anime"
|
| 179 |
-
)
|
| 180 |
|
| 181 |
prompt = gr.Text(
|
| 182 |
label="Edit Prompt",
|
|
@@ -186,15 +180,21 @@ with gr.Blocks(css=css, theme=steel_blue_theme) as demo:
|
|
| 186 |
|
| 187 |
run_button = gr.Button("Run", variant="primary")
|
| 188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
with gr.Accordion("⚙️ Advanced Settings", open=False):
|
| 190 |
seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0)
|
| 191 |
randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
|
| 192 |
guidance_scale = gr.Slider(label="Guidance Scale", minimum=1.0, maximum=10.0, step=0.1, value=1.0)
|
| 193 |
steps = gr.Slider(label="Inference Steps", minimum=1, maximum=50, step=1, value=4)
|
| 194 |
-
|
| 195 |
-
with gr.Column():
|
| 196 |
-
output_image = gr.Image(label="Output Image", interactive=False, format="png", height=400)
|
| 197 |
-
|
| 198 |
gr.Examples(
|
| 199 |
examples=[
|
| 200 |
["examples/1.jpg", "Transform into anime.", "Photo-to-Anime"],
|
|
@@ -202,7 +202,6 @@ with gr.Blocks(css=css, theme=steel_blue_theme) as demo:
|
|
| 202 |
["examples/5.jpg", "Relight the image using soft, diffused lighting that simulates sunlight filtering through curtains.", "Relight"],
|
| 203 |
["examples/2.jpeg", "Move the camera left.", "Multiple-Angles"],
|
| 204 |
["examples/2.jpeg", "Move the camera right.", "Multiple-Angles"],
|
| 205 |
-
["examples/2.jpeg", "Move the camera down.", "Multiple-Angles"],
|
| 206 |
["examples/2.jpeg", "Rotate the camera 45 degrees to the left.", "Multiple-Angles"],
|
| 207 |
["examples/3.jpg", "Rotate the camera 45 degrees to the right.", "Multiple-Angles"],
|
| 208 |
["examples/3.jpg", "Switch the camera to a top-down view.", "Multiple-Angles"],
|
|
@@ -212,7 +211,7 @@ with gr.Blocks(css=css, theme=steel_blue_theme) as demo:
|
|
| 212 |
inputs=[input_image, prompt, lora_adapter],
|
| 213 |
outputs=[output_image, seed],
|
| 214 |
fn=infer_example,
|
| 215 |
-
cache_examples=
|
| 216 |
label="Examples"
|
| 217 |
)
|
| 218 |
|
|
|
|
| 170 |
|
| 171 |
with gr.Row(equal_height=True):
|
| 172 |
with gr.Column():
|
| 173 |
+
input_image = gr.Image(label="Upload Image", type="pil")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
|
| 175 |
prompt = gr.Text(
|
| 176 |
label="Edit Prompt",
|
|
|
|
| 180 |
|
| 181 |
run_button = gr.Button("Run", variant="primary")
|
| 182 |
|
| 183 |
+
with gr.Column():
|
| 184 |
+
output_image = gr.Image(label="Output Image", interactive=False, format="png", height=290)
|
| 185 |
+
|
| 186 |
+
with gr.Row():
|
| 187 |
+
lora_adapter = gr.Dropdown(
|
| 188 |
+
label="Choose Editing Style",
|
| 189 |
+
choices=["Photo-to-Anime", "Multiple-Angles", "Light-Restoration", "Relight"],
|
| 190 |
+
value="Photo-to-Anime"
|
| 191 |
+
)
|
| 192 |
with gr.Accordion("⚙️ Advanced Settings", open=False):
|
| 193 |
seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0)
|
| 194 |
randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
|
| 195 |
guidance_scale = gr.Slider(label="Guidance Scale", minimum=1.0, maximum=10.0, step=0.1, value=1.0)
|
| 196 |
steps = gr.Slider(label="Inference Steps", minimum=1, maximum=50, step=1, value=4)
|
| 197 |
+
|
|
|
|
|
|
|
|
|
|
| 198 |
gr.Examples(
|
| 199 |
examples=[
|
| 200 |
["examples/1.jpg", "Transform into anime.", "Photo-to-Anime"],
|
|
|
|
| 202 |
["examples/5.jpg", "Relight the image using soft, diffused lighting that simulates sunlight filtering through curtains.", "Relight"],
|
| 203 |
["examples/2.jpeg", "Move the camera left.", "Multiple-Angles"],
|
| 204 |
["examples/2.jpeg", "Move the camera right.", "Multiple-Angles"],
|
|
|
|
| 205 |
["examples/2.jpeg", "Rotate the camera 45 degrees to the left.", "Multiple-Angles"],
|
| 206 |
["examples/3.jpg", "Rotate the camera 45 degrees to the right.", "Multiple-Angles"],
|
| 207 |
["examples/3.jpg", "Switch the camera to a top-down view.", "Multiple-Angles"],
|
|
|
|
| 211 |
inputs=[input_image, prompt, lora_adapter],
|
| 212 |
outputs=[output_image, seed],
|
| 213 |
fn=infer_example,
|
| 214 |
+
cache_examples=False,
|
| 215 |
label="Examples"
|
| 216 |
)
|
| 217 |
|