Commit
·
ffb6a5b
1
Parent(s):
9a137bc
Update app.py
Browse files
app.py
CHANGED
@@ -185,10 +185,10 @@ def txt2img(prompt, negative_prompt, model, width, height):
|
|
185 |
|
186 |
return job["imageUrl"]
|
187 |
|
188 |
-
def img2img(input_image, prompt, negative_prompt, model, width, height):
|
189 |
result = prodia_client.transform({
|
190 |
"imageData": image_to_base64(input_image),
|
191 |
-
"denoising_strength":
|
192 |
"prompt": prompt,
|
193 |
"negative_prompt": negative_prompt,
|
194 |
"model": i2i_model.value,
|
@@ -256,11 +256,14 @@ with gr.Blocks(css=css, theme="Base") as demo:
|
|
256 |
value="absolutereality_v181.safetensors [3d9d4d2b]",
|
257 |
show_label=True, label="Model",
|
258 |
choices=prodia_client.list_models())
|
|
|
|
|
|
|
259 |
with gr.Column(scale=1):
|
260 |
i2i_width = gr.Slider(label="↔️ Width", maximum=1024, value=768, step=8)
|
261 |
i2i_height = gr.Slider(label="↕️ Height", maximum=1024, value=768, step=8)
|
262 |
|
263 |
-
i2i_text_button.click(img2img, inputs=[i2i_image_input, i2i_prompt, i2i_negative_prompt, model, i2i_width, i2i_height], outputs=i2i_image_output)
|
264 |
|
265 |
|
266 |
demo.queue(concurrency_count=64, max_size=30, api_open=False).launch(max_threads=256, show_api=False)
|
|
|
185 |
|
186 |
return job["imageUrl"]
|
187 |
|
188 |
+
def img2img(input_image, denoising, prompt, negative_prompt, model, width, height):
|
189 |
result = prodia_client.transform({
|
190 |
"imageData": image_to_base64(input_image),
|
191 |
+
"denoising_strength": denoising,
|
192 |
"prompt": prompt,
|
193 |
"negative_prompt": negative_prompt,
|
194 |
"model": i2i_model.value,
|
|
|
256 |
value="absolutereality_v181.safetensors [3d9d4d2b]",
|
257 |
show_label=True, label="Model",
|
258 |
choices=prodia_client.list_models())
|
259 |
+
|
260 |
+
with gr.Column(scale=1):
|
261 |
+
i2i_denoising = gr.Slider(label="Denoising Strength", minimum=0, maximum=1, value=0.7, step=0.1)
|
262 |
with gr.Column(scale=1):
|
263 |
i2i_width = gr.Slider(label="↔️ Width", maximum=1024, value=768, step=8)
|
264 |
i2i_height = gr.Slider(label="↕️ Height", maximum=1024, value=768, step=8)
|
265 |
|
266 |
+
i2i_text_button.click(img2img, inputs=[i2i_image_input, i2i_denoising, i2i_prompt, i2i_negative_prompt, model, i2i_width, i2i_height], outputs=i2i_image_output)
|
267 |
|
268 |
|
269 |
demo.queue(concurrency_count=64, max_size=30, api_open=False).launch(max_threads=256, show_api=False)
|