Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -138,7 +138,8 @@ def infer_30(
|
|
138 |
# pipe.unet.to('cpu')
|
139 |
upscaler_2.to(torch.device('cuda'))
|
140 |
with torch.no_grad():
|
141 |
-
|
|
|
142 |
print('-- got upscaled image --')
|
143 |
downscale2 = upscale2.resize((upscale2.width // 4, upscale2.height // 4),Image.LANCZOS)
|
144 |
upscale_path = f"sd35l_upscale_{timestamp}.png"
|
@@ -186,7 +187,8 @@ def infer_60(
|
|
186 |
# pipe.unet.to('cpu')
|
187 |
upscaler_2.to(torch.device('cuda'))
|
188 |
with torch.no_grad():
|
189 |
-
|
|
|
190 |
print('-- got upscaled image --')
|
191 |
downscale2 = upscale2.resize((upscale2.width // 4, upscale2.height // 4),Image.LANCZOS)
|
192 |
upscale_path = f"sd35l_upscale_{timestamp}.png"
|
@@ -234,7 +236,8 @@ def infer_90(
|
|
234 |
# pipe.unet.to('cpu')
|
235 |
upscaler_2.to(torch.device('cuda'))
|
236 |
with torch.no_grad():
|
237 |
-
|
|
|
238 |
print('-- got upscaled image --')
|
239 |
downscale2 = upscale2.resize((upscale2.width // 4, upscale2.height // 4),Image.LANCZOS)
|
240 |
upscale_path = f"sd35l_upscale_{timestamp}.png"
|
@@ -279,7 +282,8 @@ def infer_100(
|
|
279 |
# pipe.unet.to('cpu')
|
280 |
upscaler_2.to(torch.device('cuda'))
|
281 |
with torch.no_grad():
|
282 |
-
|
|
|
283 |
print('-- got upscaled image --')
|
284 |
downscale2 = upscale2.resize((upscale2.width // 4, upscale2.height // 4),Image.LANCZOS)
|
285 |
upscale_path = f"sd35l_upscale_{timestamp}.png"
|
|
|
138 |
# pipe.unet.to('cpu')
|
139 |
upscaler_2.to(torch.device('cuda'))
|
140 |
with torch.no_grad():
|
141 |
+
upscale = upscaler_2(sd_image, tiling=True, tile_width=256, tile_height=256)
|
142 |
+
upscale2 = upscaler_2(upscale, tiling=True, tile_width=256, tile_height=256)
|
143 |
print('-- got upscaled image --')
|
144 |
downscale2 = upscale2.resize((upscale2.width // 4, upscale2.height // 4),Image.LANCZOS)
|
145 |
upscale_path = f"sd35l_upscale_{timestamp}.png"
|
|
|
187 |
# pipe.unet.to('cpu')
|
188 |
upscaler_2.to(torch.device('cuda'))
|
189 |
with torch.no_grad():
|
190 |
+
upscale = upscaler_2(sd_image, tiling=True, tile_width=256, tile_height=256)
|
191 |
+
upscale2 = upscaler_2(upscale, tiling=True, tile_width=256, tile_height=256)
|
192 |
print('-- got upscaled image --')
|
193 |
downscale2 = upscale2.resize((upscale2.width // 4, upscale2.height // 4),Image.LANCZOS)
|
194 |
upscale_path = f"sd35l_upscale_{timestamp}.png"
|
|
|
236 |
# pipe.unet.to('cpu')
|
237 |
upscaler_2.to(torch.device('cuda'))
|
238 |
with torch.no_grad():
|
239 |
+
upscale = upscaler_2(sd_image, tiling=True, tile_width=256, tile_height=256)
|
240 |
+
upscale2 = upscaler_2(upscale, tiling=True, tile_width=256, tile_height=256)
|
241 |
print('-- got upscaled image --')
|
242 |
downscale2 = upscale2.resize((upscale2.width // 4, upscale2.height // 4),Image.LANCZOS)
|
243 |
upscale_path = f"sd35l_upscale_{timestamp}.png"
|
|
|
282 |
# pipe.unet.to('cpu')
|
283 |
upscaler_2.to(torch.device('cuda'))
|
284 |
with torch.no_grad():
|
285 |
+
upscale = upscaler_2(sd_image, tiling=True, tile_width=256, tile_height=256)
|
286 |
+
upscale2 = upscaler_2(upscale, tiling=True, tile_width=256, tile_height=256)
|
287 |
print('-- got upscaled image --')
|
288 |
downscale2 = upscale2.resize((upscale2.width // 4, upscale2.height // 4),Image.LANCZOS)
|
289 |
upscale_path = f"sd35l_upscale_{timestamp}.png"
|