Spaces:
Runtime error
Runtime error
tombetthauser
commited on
Commit
Β·
359e6bf
1
Parent(s):
84d62ac
Update app.py
Browse files
app.py
CHANGED
@@ -169,7 +169,7 @@ for model in model_tags:
|
|
169 |
if model != "ahx-model-1" and model != "ahx-model-2":
|
170 |
DROPDOWNS[model] = f" in the style of <{model}>"
|
171 |
|
172 |
-
# def image_prompt(prompt, dropdown, guidance, steps, seed, height, width):
|
173 |
def image_prompt(prompt, guidance, steps, seed, height, width):
|
174 |
# prompt = prompt + DROPDOWNS[dropdown]
|
175 |
square_pixels = height * width
|
@@ -194,8 +194,8 @@ def image_prompt(prompt, guidance, steps, seed, height, width):
|
|
194 |
|
195 |
if is_clean:
|
196 |
return (
|
197 |
-
pipe(prompt=prompt, guidance_scale=guidance, num_inference_steps=steps, generator=generator, height=height, width=width).images[0],
|
198 |
-
f"prompt: '{prompt}', seed = {int(seed)},\nheight: {height}px, width: {width}px,\nguidance: {guidance}, steps: {steps}"
|
199 |
)
|
200 |
else:
|
201 |
return (
|
@@ -248,6 +248,7 @@ with gr.Blocks(css=".gradio-container {max-width: 650px}") as advanced_tab:
|
|
248 |
prompt = gr.Textbox(label="image prompt...", elem_id="input-text")
|
249 |
with gr.Row():
|
250 |
seed = gr.Slider(0, 99999999999999, label="seed", dtype=int, value=random_seed, interactive=True, step=1)
|
|
|
251 |
with gr.Row():
|
252 |
with gr.Column():
|
253 |
guidance = gr.Slider(0, 10, label="guidance", dtype=float, value=default_guidance, step=0.1, interactive=True)
|
@@ -263,7 +264,7 @@ with gr.Blocks(css=".gradio-container {max-width: 650px}") as advanced_tab:
|
|
263 |
go_button = gr.Button("generate image", elem_id="go-button")
|
264 |
output = gr.Image(elem_id="output-image")
|
265 |
output_text = gr.Text(elem_id="output-text")
|
266 |
-
go_button.click(fn=image_prompt, inputs=[prompt, guidance, steps, seed, height, width], outputs=[output, output_text])
|
267 |
gr.Markdown("For a complete list of usable models and beta concepts check out the dropdown selectors in the welcome and beta concepts tabs or the project's main website or our discord.\n\nhttp://www.astronaut.horse/concepts")
|
268 |
|
269 |
|
|
|
169 |
if model != "ahx-model-1" and model != "ahx-model-2":
|
170 |
DROPDOWNS[model] = f" in the style of <{model}>"
|
171 |
|
172 |
+
# def image_prompt(prompt, dropdown, guidance, steps, seed, height, width, negative_prompt=""):
|
173 |
def image_prompt(prompt, guidance, steps, seed, height, width):
|
174 |
# prompt = prompt + DROPDOWNS[dropdown]
|
175 |
square_pixels = height * width
|
|
|
194 |
|
195 |
if is_clean:
|
196 |
return (
|
197 |
+
pipe(prompt=prompt, guidance_scale=guidance, num_inference_steps=steps, generator=generator, height=height, width=width, negative_prompt=negative_prompt).images[0],
|
198 |
+
f"prompt: '{prompt}', seed = {int(seed)},\nheight: {height}px, width: {width}px,\nguidance: {guidance}, steps: {steps}, negative prompt: {negative_prompt}"
|
199 |
)
|
200 |
else:
|
201 |
return (
|
|
|
248 |
prompt = gr.Textbox(label="image prompt...", elem_id="input-text")
|
249 |
with gr.Row():
|
250 |
seed = gr.Slider(0, 99999999999999, label="seed", dtype=int, value=random_seed, interactive=True, step=1)
|
251 |
+
negative_prompt = gr.Textbox(label="negative prompt (optional)", elem_id="input-text")
|
252 |
with gr.Row():
|
253 |
with gr.Column():
|
254 |
guidance = gr.Slider(0, 10, label="guidance", dtype=float, value=default_guidance, step=0.1, interactive=True)
|
|
|
264 |
go_button = gr.Button("generate image", elem_id="go-button")
|
265 |
output = gr.Image(elem_id="output-image")
|
266 |
output_text = gr.Text(elem_id="output-text")
|
267 |
+
go_button.click(fn=image_prompt, inputs=[prompt, guidance, steps, seed, height, width, negative_prompt], outputs=[output, output_text])
|
268 |
gr.Markdown("For a complete list of usable models and beta concepts check out the dropdown selectors in the welcome and beta concepts tabs or the project's main website or our discord.\n\nhttp://www.astronaut.horse/concepts")
|
269 |
|
270 |
|