Spaces:
Runtime error
Runtime error
Commit
·
06f120f
1
Parent(s):
c65f9ed
Update app.py
Browse files
app.py
CHANGED
|
@@ -81,17 +81,18 @@ def image_to_base64(image_path):
|
|
| 81 |
|
| 82 |
prodia_client = Prodia(api_key=os.getenv("PRODIA_API_KEY"))
|
| 83 |
|
| 84 |
-
def flip_text(prompt, negative_prompt, model, steps, sampler, width, height):
|
| 85 |
result = prodia_client.generate({
|
| 86 |
"prompt": prompt,
|
| 87 |
"negative_prompt": negative_prompt,
|
| 88 |
"model": model,
|
| 89 |
"steps": steps,
|
| 90 |
"sampler": sampler,
|
| 91 |
-
"cfg_scale":
|
| 92 |
"width": width,
|
| 93 |
"height": height,
|
| 94 |
-
"seed":
|
|
|
|
| 95 |
})
|
| 96 |
|
| 97 |
job = prodia_client.wait(result)
|
|
@@ -154,17 +155,18 @@ with gr.Blocks(css=css) as demo:
|
|
| 154 |
])
|
| 155 |
|
| 156 |
with gr.Column(scale=1):
|
| 157 |
-
steps = gr.Slider(label="Steps", minimum=1, maximum=50, value=30, step=1)
|
| 158 |
|
| 159 |
with gr.Row():
|
| 160 |
with gr.Column(scale=1):
|
| 161 |
width = gr.Slider(label="Width", maximum=1024, value=512, step=8)
|
| 162 |
height = gr.Slider(label="Height", maximum=1024, value=512, step=8)
|
| 163 |
|
|
|
|
|
|
|
| 164 |
|
| 165 |
|
| 166 |
-
|
| 167 |
-
text_button.click(flip_text, inputs=[prompt, negative_prompt, model, sampler, width, height], outputs=image_output)
|
| 168 |
|
| 169 |
demo.queue(concurrency_count=10)
|
| 170 |
demo.launch()
|
|
|
|
| 81 |
|
| 82 |
prodia_client = Prodia(api_key=os.getenv("PRODIA_API_KEY"))
|
| 83 |
|
| 84 |
+
def flip_text(prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed, upscale):
|
| 85 |
result = prodia_client.generate({
|
| 86 |
"prompt": prompt,
|
| 87 |
"negative_prompt": negative_prompt,
|
| 88 |
"model": model,
|
| 89 |
"steps": steps,
|
| 90 |
"sampler": sampler,
|
| 91 |
+
"cfg_scale": cfg_scale,
|
| 92 |
"width": width,
|
| 93 |
"height": height,
|
| 94 |
+
"seed": seed,
|
| 95 |
+
"upscale": True
|
| 96 |
})
|
| 97 |
|
| 98 |
job = prodia_client.wait(result)
|
|
|
|
| 155 |
])
|
| 156 |
|
| 157 |
with gr.Column(scale=1):
|
| 158 |
+
steps = gr.Slider(label="Steps", minimum=1, maximum=50, value=30, step=1, interactive=True)
|
| 159 |
|
| 160 |
with gr.Row():
|
| 161 |
with gr.Column(scale=1):
|
| 162 |
width = gr.Slider(label="Width", maximum=1024, value=512, step=8)
|
| 163 |
height = gr.Slider(label="Height", maximum=1024, value=512, step=8)
|
| 164 |
|
| 165 |
+
cfg_scale = gr.Slider(label="CFG Scale", minimum=1, maximum=20, value=7, step=1)
|
| 166 |
+
seed = gr.Number(label="Seed", value=-1, info = """'-1' is a random seed""")
|
| 167 |
|
| 168 |
|
| 169 |
+
text_button.click(flip_text, inputs=[prompt, negative_prompt, model, sampler, width, height, cfg_scale, seed], outputs=image_output)
|
|
|
|
| 170 |
|
| 171 |
demo.queue(concurrency_count=10)
|
| 172 |
demo.launch()
|