Update app.py
Browse files
app.py
CHANGED
@@ -158,6 +158,10 @@ for model_name in model_list:
|
|
158 |
|
159 |
|
160 |
def txt2img(prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed):
|
|
|
|
|
|
|
|
|
161 |
result = prodia_client.generate({
|
162 |
"prompt": prompt,
|
163 |
"negative_prompt": negative_prompt,
|
@@ -181,6 +185,9 @@ def txt2img(prompt, negative_prompt, model, steps, sampler, cfg_scale, width, he
|
|
181 |
def img2img(input_image, denoising, prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed):
|
182 |
if input_image is None:
|
183 |
raise gr.Error("Please add an image to run img2img")
|
|
|
|
|
|
|
184 |
|
185 |
result = prodia_client.transform({
|
186 |
"imageData": image_to_base64(input_image),
|
|
|
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,
|
167 |
"negative_prompt": negative_prompt,
|
|
|
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),
|