Deadmon commited on
Commit
0b90bff
·
verified ·
1 Parent(s): 662515a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -28,10 +28,13 @@ def generate_image(prompt, image=None, output_filename="generated_image"):
28
  img_byte_arr = io.BytesIO()
29
  image.save(img_byte_arr, format="PNG")
30
  img_bytes = img_byte_arr.getvalue()
31
- parts.append(types.Part.from_inline_data(
32
- mime_type="image/png",
33
- data=img_bytes
34
- ))
 
 
 
35
 
36
  contents = [
37
  types.Content(
 
28
  img_byte_arr = io.BytesIO()
29
  image.save(img_byte_arr, format="PNG")
30
  img_bytes = img_byte_arr.getvalue()
31
+ # Add the image as a Part with inline_data
32
+ parts.append({
33
+ "inline_data": {
34
+ "mime_type": "image/png",
35
+ "data": img_bytes
36
+ }
37
+ })
38
 
39
  contents = [
40
  types.Content(