You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
swarms/examples/models/dalle3_concurrent_example.py

24 lines
509 B

"""
User task ->> GPT4 for prompt enrichment ->> Dalle3V for image generation
->> GPT4Vision for image captioning ->> Dalle3 better image
"""
import os
from swarms.models.dalle3 import Dalle3
api_key = os.environ["OPENAI_API_KEY"]
dalle3 = Dalle3(openai_api_key=api_key, n=1)
# task = "Swarm of robots working super industrial ambience concept art"
# image_url = dalle3(task)
tasks = ["A painting of a dog", "A painting of a cat"]
results = dalle3.process_batch_concurrently(tasks)
# print(results)