Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -158,9 +158,6 @@ for model_name in model_list:
|
|
| 158 |
|
| 159 |
|
| 160 |
def txt2img(prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed):
|
| 161 |
-
|
| 162 |
-
if width == 0 or height == 0:
|
| 163 |
-
raise gr.Error("width&height should be > 0")
|
| 164 |
|
| 165 |
result = prodia_client.generate({
|
| 166 |
"prompt": prompt,
|
|
@@ -185,9 +182,6 @@ def txt2img(prompt, negative_prompt, model, steps, sampler, cfg_scale, width, he
|
|
| 185 |
def img2img(input_image, denoising, prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed):
|
| 186 |
if input_image is None:
|
| 187 |
raise gr.Error("Please add an image to run img2img")
|
| 188 |
-
|
| 189 |
-
if width == 0 or height == 0:
|
| 190 |
-
raise gr.Error("width&height should be > 0")
|
| 191 |
|
| 192 |
result = prodia_client.transform({
|
| 193 |
"imageData": image_to_base64(input_image),
|
|
@@ -246,8 +240,8 @@ with gr.Blocks(css=css) as demo:
|
|
| 246 |
|
| 247 |
with gr.Row():
|
| 248 |
with gr.Column(scale=1):
|
| 249 |
-
width = gr.Slider(label="Width", maximum=1024, value=512, step=8)
|
| 250 |
-
height = gr.Slider(label="Height", maximum=1024, value=512, step=8)
|
| 251 |
|
| 252 |
with gr.Column(scale=1):
|
| 253 |
batch_size = gr.Slider(label="Batch Size", maximum=1, value=1)
|
|
|
|
| 158 |
|
| 159 |
|
| 160 |
def txt2img(prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed):
|
|
|
|
|
|
|
|
|
|
| 161 |
|
| 162 |
result = prodia_client.generate({
|
| 163 |
"prompt": prompt,
|
|
|
|
| 182 |
def img2img(input_image, denoising, prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed):
|
| 183 |
if input_image is None:
|
| 184 |
raise gr.Error("Please add an image to run img2img")
|
|
|
|
|
|
|
|
|
|
| 185 |
|
| 186 |
result = prodia_client.transform({
|
| 187 |
"imageData": image_to_base64(input_image),
|
|
|
|
| 240 |
|
| 241 |
with gr.Row():
|
| 242 |
with gr.Column(scale=1):
|
| 243 |
+
width = gr.Slider(label="Width", maximum=1024, minimum=128, value=512, step=8)
|
| 244 |
+
height = gr.Slider(label="Height", maximum=1024, minimum=128, value=512, step=8)
|
| 245 |
|
| 246 |
with gr.Column(scale=1):
|
| 247 |
batch_size = gr.Slider(label="Batch Size", maximum=1, value=1)
|