Sebastiankay commited on
Commit
92e1468
1 Parent(s): 8c192f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -162,7 +162,7 @@ def process(Prompt, used_model, image_width, image_height, image_ratio, image_se
162
 
163
  timestamp = datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
164
  filename_prompt = re.sub(r"[^\w\s-]", "", Prompt).strip().replace(" ", "_")
165
- filename = timestamp + "_" + filename_prompt[:100] + ".png"
166
  file_path = os.path.join(IMAGE_DIR, filename)
167
 
168
  # Retry-Logik mit requests und Retry
@@ -182,7 +182,7 @@ def process(Prompt, used_model, image_width, image_height, image_ratio, image_se
182
  print("Imagine API Request solved")
183
  print("Save image to: " + file_path)
184
  img = PILImage.open(BytesIO(response.content))
185
- img.save(file_path, "PNG")
186
 
187
  # img_exif_comment = "" # read_exif(file_path)
188
  img_dominant_color = image_get_dominant_color(file_path)
 
162
 
163
  timestamp = datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
164
  filename_prompt = re.sub(r"[^\w\s-]", "", Prompt).strip().replace(" ", "_")
165
+ filename = timestamp + "_" + filename_prompt[:100] + ".jpg"
166
  file_path = os.path.join(IMAGE_DIR, filename)
167
 
168
  # Retry-Logik mit requests und Retry
 
182
  print("Imagine API Request solved")
183
  print("Save image to: " + file_path)
184
  img = PILImage.open(BytesIO(response.content))
185
+ img.save(file_path, "JPG")
186
 
187
  # img_exif_comment = "" # read_exif(file_path)
188
  img_dominant_color = image_get_dominant_color(file_path)