Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,8 +62,11 @@ def generate(
|
|
| 62 |
url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
|
| 63 |
|
| 64 |
response = requests.get(url)
|
|
|
|
| 65 |
init_image = Image.open(BytesIO(response.content)).convert("RGB")
|
| 66 |
init_image = init_image.resize((768, 512))
|
|
|
|
|
|
|
| 67 |
|
| 68 |
if use_vae:
|
| 69 |
vae = AutoencoderKL.from_pretrained(vaecall, torch_dtype=torch.float16)
|
|
|
|
| 62 |
url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
|
| 63 |
|
| 64 |
response = requests.get(url)
|
| 65 |
+
if response.status_code == 200:
|
| 66 |
init_image = Image.open(BytesIO(response.content)).convert("RGB")
|
| 67 |
init_image = init_image.resize((768, 512))
|
| 68 |
+
else:
|
| 69 |
+
print(f"Error downloading image: {response.status_code}")
|
| 70 |
|
| 71 |
if use_vae:
|
| 72 |
vae = AutoencoderKL.from_pretrained(vaecall, torch_dtype=torch.float16)
|