Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -129,13 +129,13 @@ def generate(
|
|
129 |
image,
|
130 |
prompt,
|
131 |
conditioning,
|
132 |
-
negative_prompt,
|
133 |
-
seed,
|
134 |
-
randomize_seed,
|
135 |
-
controlnet_conditioning_scale,
|
136 |
-
guidance_scale,
|
137 |
-
num_inference_steps,
|
138 |
-
prompt_enhance,
|
139 |
progress=gr.Progress(track_tqdm=True),
|
140 |
):
|
141 |
if image is None:
|
@@ -208,7 +208,6 @@ with gr.Blocks(css=css, theme=gr.themes.Citrus()) as demo:
|
|
208 |
with gr.Column(scale=1):
|
209 |
generated_image_output = gr.Image(label="Generated Image", interactive=False)
|
210 |
control_image_output = gr.Image(label="Control Image (Preprocessor Output)", interactive=False)
|
211 |
-
used_seed = gr.Number(label="Used Seed", interactive=False)
|
212 |
|
213 |
gr.Examples(
|
214 |
examples=[
|
@@ -217,15 +216,15 @@ with gr.Blocks(css=css, theme=gr.themes.Citrus()) as demo:
|
|
217 |
["dog.jpg", "A cat on the park", "Soft Edge"]
|
218 |
],
|
219 |
inputs=[input_image, prompt, conditioning],
|
220 |
-
outputs=[generated_image_output, control_image_output,
|
221 |
fn=generate,
|
222 |
-
cache_examples=
|
223 |
)
|
224 |
|
225 |
run_button.click(
|
226 |
fn=generate,
|
227 |
inputs=[input_image, prompt, conditioning, negative_prompt, seed, randomize_seed, controlnet_conditioning_scale, guidance_scale, num_inference_steps, prompt_enhance],
|
228 |
-
outputs=[generated_image_output, control_image_output,
|
229 |
api_name="generate"
|
230 |
)
|
231 |
|
|
|
129 |
image,
|
130 |
prompt,
|
131 |
conditioning,
|
132 |
+
negative_prompt="worst quality, low quality, blurry, text, watermark, logo",
|
133 |
+
seed=42,
|
134 |
+
randomize_seed=False,
|
135 |
+
controlnet_conditioning_scale=0.8,
|
136 |
+
guidance_scale=5.0,
|
137 |
+
num_inference_steps=50,
|
138 |
+
prompt_enhance=True,
|
139 |
progress=gr.Progress(track_tqdm=True),
|
140 |
):
|
141 |
if image is None:
|
|
|
208 |
with gr.Column(scale=1):
|
209 |
generated_image_output = gr.Image(label="Generated Image", interactive=False)
|
210 |
control_image_output = gr.Image(label="Control Image (Preprocessor Output)", interactive=False)
|
|
|
211 |
|
212 |
gr.Examples(
|
213 |
examples=[
|
|
|
216 |
["dog.jpg", "A cat on the park", "Soft Edge"]
|
217 |
],
|
218 |
inputs=[input_image, prompt, conditioning],
|
219 |
+
outputs=[generated_image_output, control_image_output, seed],
|
220 |
fn=generate,
|
221 |
+
cache_examples="lazy",
|
222 |
)
|
223 |
|
224 |
run_button.click(
|
225 |
fn=generate,
|
226 |
inputs=[input_image, prompt, conditioning, negative_prompt, seed, randomize_seed, controlnet_conditioning_scale, guidance_scale, num_inference_steps, prompt_enhance],
|
227 |
+
outputs=[generated_image_output, control_image_output, seed],
|
228 |
api_name="generate"
|
229 |
)
|
230 |
|