Update app.py
Browse files
app.py
CHANGED
@@ -21,12 +21,12 @@ upscaler4x = upscaler4x.to(device)
|
|
21 |
def upscale(raw_img, model, prompt, negative_prompt, scale, steps):
|
22 |
generator = torch.manual_seed(999999)
|
23 |
raw_img = Image.open(raw_img).convert("RGB")
|
24 |
-
low_res_img = raw_img.resize((128, 128))
|
25 |
if model == "Upscaler 4x":
|
26 |
-
|
27 |
-
else:
|
28 |
-
|
29 |
-
|
|
|
30 |
|
31 |
#launch interface
|
32 |
|
|
|
21 |
def upscale(raw_img, model, prompt, negative_prompt, scale, steps):
|
22 |
generator = torch.manual_seed(999999)
|
23 |
raw_img = Image.open(raw_img).convert("RGB")
|
|
|
24 |
if model == "Upscaler 4x":
|
25 |
+
upscaled_image = upscaler4x(prompt=prompt, negative_prompt=negative_prompt, image=low_res_img, guidance_scale=scale, num_inference_steps=steps).images[0]
|
26 |
+
else:
|
27 |
+
low_res_img = raw_img.resize((128, 128))
|
28 |
+
upscaled_image = upscaler2x(prompt=prompt, negative_prompt=negative_prompt, image=raw_img, guidance_scale=scale, num_inference_steps=steps).images[0]
|
29 |
+
return upscaled_image
|
30 |
|
31 |
#launch interface
|
32 |
|