Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -58,7 +58,6 @@ def generate(
|
|
| 58 |
vaecall = 'stabilityai/sd-vae-ft-mse',
|
| 59 |
lora = 'amazonaws-la/juliette',
|
| 60 |
lora_scale: float = 0.7,
|
| 61 |
-
url = 'https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg',
|
| 62 |
) -> PIL.Image.Image:
|
| 63 |
if torch.cuda.is_available():
|
| 64 |
|
|
@@ -73,9 +72,10 @@ def generate(
|
|
| 73 |
pipe.load_lora_weights(lora)
|
| 74 |
pipe.fuse_lora(lora_scale=0.7)
|
| 75 |
|
|
|
|
| 76 |
response = requests.get(url)
|
| 77 |
-
|
| 78 |
-
|
| 79 |
|
| 80 |
if ENABLE_CPU_OFFLOAD:
|
| 81 |
pipe.enable_model_cpu_offload()
|
|
|
|
| 58 |
vaecall = 'stabilityai/sd-vae-ft-mse',
|
| 59 |
lora = 'amazonaws-la/juliette',
|
| 60 |
lora_scale: float = 0.7,
|
|
|
|
| 61 |
) -> PIL.Image.Image:
|
| 62 |
if torch.cuda.is_available():
|
| 63 |
|
|
|
|
| 72 |
pipe.load_lora_weights(lora)
|
| 73 |
pipe.fuse_lora(lora_scale=0.7)
|
| 74 |
|
| 75 |
+
url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
|
| 76 |
response = requests.get(url)
|
| 77 |
+
init_img = Image.open(BytesIO(response.content)).convert("RGB")
|
| 78 |
+
init_img = init_img.resize((1024, 1024))
|
| 79 |
|
| 80 |
if ENABLE_CPU_OFFLOAD:
|
| 81 |
pipe.enable_model_cpu_offload()
|