Spaces:
Running
Running
Update app.py
Browse filesChanged the default when no model is selected to the 2x upscaler
app.py
CHANGED
@@ -21,12 +21,12 @@ def upscale_image(model, input_image):
|
|
21 |
generator = torch.manual_seed(999999)
|
22 |
input_image = Image.open(input_image).convert("RGB")
|
23 |
# Upscale the image using the selected model
|
24 |
-
if model == "SD 2.
|
25 |
-
upscaled_image = sd_2_0_2x(prompt="", image=input_image, num_inference_steps=5).images[0]
|
26 |
-
else:
|
27 |
low_res_img = input_image.resize((128, 128))
|
28 |
upscaled_image = sd_2_1_4x(prompt="", image=low_res_img, num_inference_steps=5).images[0]
|
29 |
-
|
|
|
|
|
30 |
return upscaled_image
|
31 |
|
32 |
# Define the Gradio interface
|
|
|
21 |
generator = torch.manual_seed(999999)
|
22 |
input_image = Image.open(input_image).convert("RGB")
|
23 |
# Upscale the image using the selected model
|
24 |
+
if model == "SD 2.1 4x Upscaler":
|
|
|
|
|
25 |
low_res_img = input_image.resize((128, 128))
|
26 |
upscaled_image = sd_2_1_4x(prompt="", image=low_res_img, num_inference_steps=5).images[0]
|
27 |
+
else:
|
28 |
+
upscaled_image = sd_2_0_2x(prompt="", image=input_image, num_inference_steps=5).images[0]
|
29 |
+
# Return the upscaled image
|
30 |
return upscaled_image
|
31 |
|
32 |
# Define the Gradio interface
|