amazonaws-sp commited on
Commit
4e14ada
·
verified ·
1 Parent(s): a2b83e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
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)