Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -55,7 +55,7 @@ def infer(
|
|
55 |
generator=generator,
|
56 |
).images[0]
|
57 |
|
58 |
-
return image, seed
|
59 |
|
60 |
|
61 |
examples = [
|
@@ -93,7 +93,7 @@ with gr.Blocks(css=css) as demo:
|
|
93 |
label="Negative prompt",
|
94 |
max_lines=1,
|
95 |
placeholder="Enter a negative prompt",
|
96 |
-
visible=True,
|
97 |
)
|
98 |
|
99 |
seed = gr.Slider(
|
@@ -140,7 +140,12 @@ with gr.Blocks(css=css) as demo:
|
|
140 |
value=35, # Replace with defaults that work for your model
|
141 |
)
|
142 |
|
|
|
|
|
|
|
|
|
143 |
gr.Examples(examples=examples, inputs=[prompt])
|
|
|
144 |
gr.on(
|
145 |
triggers=[run_button.click, prompt.submit],
|
146 |
fn=infer,
|
@@ -154,7 +159,7 @@ with gr.Blocks(css=css) as demo:
|
|
154 |
guidance_scale,
|
155 |
num_inference_steps,
|
156 |
],
|
157 |
-
outputs=[result, seed],
|
158 |
)
|
159 |
|
160 |
if __name__ == "__main__":
|
|
|
55 |
generator=generator,
|
56 |
).images[0]
|
57 |
|
58 |
+
return image, seed, full_prompt, full_negative_prompt
|
59 |
|
60 |
|
61 |
examples = [
|
|
|
93 |
label="Negative prompt",
|
94 |
max_lines=1,
|
95 |
placeholder="Enter a negative prompt",
|
96 |
+
visible=True, # Show negative prompt by default
|
97 |
)
|
98 |
|
99 |
seed = gr.Slider(
|
|
|
140 |
value=35, # Replace with defaults that work for your model
|
141 |
)
|
142 |
|
143 |
+
# Add text outputs to show full prompt and negative prompt
|
144 |
+
full_prompt_output = gr.Textbox(label="Full Prompt", interactive=False)
|
145 |
+
full_negative_prompt_output = gr.Textbox(label="Full Negative Prompt", interactive=False)
|
146 |
+
|
147 |
gr.Examples(examples=examples, inputs=[prompt])
|
148 |
+
|
149 |
gr.on(
|
150 |
triggers=[run_button.click, prompt.submit],
|
151 |
fn=infer,
|
|
|
159 |
guidance_scale,
|
160 |
num_inference_steps,
|
161 |
],
|
162 |
+
outputs=[result, seed, full_prompt_output, full_negative_prompt_output],
|
163 |
)
|
164 |
|
165 |
if __name__ == "__main__":
|