Update main.py
Browse files
main.py
CHANGED
@@ -120,11 +120,12 @@ def generate_image_with_gemini(prompt):
|
|
120 |
)
|
121 |
|
122 |
for part in response.candidates[0].content.parts:
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
|
|
128 |
|
129 |
# 使用 Hugging Face 生成圖片
|
130 |
def generate_image_hf(prompt):
|
|
|
120 |
)
|
121 |
|
122 |
for part in response.candidates[0].content.parts:
|
123 |
+
if part.text is not None:
|
124 |
+
print(part.text)
|
125 |
+
elif part.inline_data is not None:
|
126 |
+
#image = PIL.Image.open(io.BytesIO(part.inline_data.data))
|
127 |
+
return part.inline_data.data
|
128 |
+
|
129 |
|
130 |
# 使用 Hugging Face 生成圖片
|
131 |
def generate_image_hf(prompt):
|