VikumK commited on
Commit
8578a36
·
verified ·
1 Parent(s): f9a48ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -119,18 +119,18 @@ def retry_with_backoff(func):
119
  return wrapper
120
 
121
  @retry_with_backoff
122
- def upload_to_imgbb(image_bytes: bytes) -> dict:
123
- """Upload image to ImgBB and return the response."""
124
- img_base64 = base64.b64encode(image_bytes).decode('utf-8')
125
- url = "https://api.imgbb.com/1/upload"
126
- payload = {
127
- "key": IMGBB_API_KEY,
128
- "image": img_base64
129
- }
130
- response = requests.post(url, payload, timeout=30)
131
- response.raise_for_status()
132
- logger.info("Successfully uploaded to ImgBB")
133
- return response.json()
134
 
135
  @retry_with_backoff
136
  def generate_image(prompt: str, width: int, height: int, steps: int) -> Tuple[Image.Image, bytes]:
 
119
  return wrapper
120
 
121
  @retry_with_backoff
122
+ #def upload_to_imgbb(image_bytes: bytes) -> dict:
123
+ # """Upload image to ImgBB and return the response."""
124
+ # img_base64 = base64.b64encode(image_bytes).decode('utf-8')
125
+ # url = "https://api.imgbb.com/1/upload"
126
+ # payload = {
127
+ # "key": IMGBB_API_KEY,
128
+ # "image": img_base64
129
+ # }
130
+ # response = requests.post(url, payload, timeout=30)
131
+ # response.raise_for_status()
132
+ # logger.info("Successfully uploaded to ImgBB")
133
+ # return response.json()
134
 
135
  @retry_with_backoff
136
  def generate_image(prompt: str, width: int, height: int, steps: int) -> Tuple[Image.Image, bytes]: