AYYasaswini commited on
Commit
32eb690
·
verified ·
1 Parent(s): dc2af09

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -189,7 +189,18 @@ def latents_to_pil(latents):
189
  """We'll use a pic from the web here, but you can load your own instead by uploading it and editing the filename in the next cell."""
190
 
191
  # Download a demo Image
192
- !curl --output macaw.jpg 'https://lafeber.com/pet-birds/wp-content/uploads/2018/06/Scarlet-Macaw-2.jpg'
 
 
 
 
 
 
 
 
 
 
 
193
 
194
  # Load the image with PIL
195
  input_image = Image.open('macaw.jpg').resize((512, 512))
 
189
  """We'll use a pic from the web here, but you can load your own instead by uploading it and editing the filename in the next cell."""
190
 
191
  # Download a demo Image
192
+ #!curl --output macaw.jpg 'https://lafeber.com/pet-birds/wp-content/uploads/2018/06/Scarlet-Macaw-2.jpg'
193
+ url = 'https://lafeber.com/pet-birds/wp-content/uploads/2018/06/Scarlet-Macaw-2.jpg'
194
+ try:
195
+ response = requests.get(url)
196
+ response.raise_for_status() # Raise an exception for HTTP errors
197
+ with open('macaw.jpg', 'wb') as file:
198
+ file.write(response.content)
199
+ print("Image downloaded successfully")
200
+ except requests.exceptions.RequestException as e:
201
+ print(f"Failed to download image: {e}")
202
+
203
+ # Call the function if this is the main module
204
 
205
  # Load the image with PIL
206
  input_image = Image.open('macaw.jpg').resize((512, 512))