Skip to content

Commit f75a812

Browse files
committed
Update
1 parent 18a7f01 commit f75a812

4 files changed

+5
-6
lines changed

images/generated_image_2366.png

3 MB
Loading

images/generated_image_4887.png

192 KB
Loading

images/generated_image_740.png

192 KB
Loading

openai-text-2-img.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,13 @@ def create_image_from_prompt(prompt: str, imagesize: str ="256x256", num_images:
4646

4747
def main():
4848
prompt = 'While traveling through a dense forest, you stumble upon an ancient, overgrown path veering off from the main trail. Do you dare to explore its mysteries?'
49-
output = text_to_image(openai_api_key,openai_api_image_generation, prompt)
49+
output = text_to_image(openai_api_key,openai_api_image_generation, prompt)
50+
image_paths1 = write_image([output])
5051

51-
image_paths = write_image([output])
52-
for image_path in image_paths:
53-
image = Image.open(image_path)
54-
image.show()
5552
image_urls = create_image_from_prompt(prompt, num_images=2)
56-
image_paths = write_image(image_urls)
53+
image_paths2 = write_image(image_urls)
54+
55+
image_paths = [*image_paths1, *image_paths2]
5756
for image_path in image_paths:
5857
image = Image.open(image_path)
5958
image.show()

0 commit comments

Comments
 (0)