Update app.py
Browse files
app.py
CHANGED
|
@@ -266,6 +266,13 @@ def infer(
|
|
| 266 |
refine_path = f"sd35_refine_{seed}.png"
|
| 267 |
refine.save(refine_path,optimize=False,compress_level=0)
|
| 268 |
upload_to_ftp(refine_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 269 |
return refine, seed, enhanced_prompt
|
| 270 |
|
| 271 |
examples = [
|
|
|
|
| 266 |
refine_path = f"sd35_refine_{seed}.png"
|
| 267 |
refine.save(refine_path,optimize=False,compress_level=0)
|
| 268 |
upload_to_ftp(refine_path)
|
| 269 |
+
with torch.no_grad():
|
| 270 |
+
upscale2 = upscaler_2(downscale, tiling=True, tile_width=1024, tile_height=1024)
|
| 271 |
+
print('-- got upscaled image --')
|
| 272 |
+
downscale2 = upscale2.resize((upscale2.width // 4, upscale2.height // 4),Image.LANCZOS)
|
| 273 |
+
upscale_path = f"sd35_upscale_{seed}.png"
|
| 274 |
+
downscale2.save(upscale_path,optimize=False,compress_level=0)
|
| 275 |
+
upload_to_ftp(upscale_path)
|
| 276 |
return refine, seed, enhanced_prompt
|
| 277 |
|
| 278 |
examples = [
|