Guides
Multi-Modal Workflows
Combining modalities for complex workflows.
Multi-Modal Workflows
One of Celeste's strengths is the ability to combine different modalities using a consistent interface.
Text to Image
Generate an image based on a detailed description created by an LLM.
import celeste
# 1. Generate prompt (domain: text)
prompt_response = await celeste.text.generate(
model="claude-sonnet-4-5",
prompt="Describe a surreal landscape with floating islands in 2 sentences.",
)
image_prompt = prompt_response.content
print(f"Generating image for: {image_prompt}")
# 2. Generate image (domain: images)
image_response = await celeste.images.generate(
model="gpt-image-1",
prompt=image_prompt,
quality="hd"
)
# 4. Save
with open("surreal_islands.png", "wb") as f:
f.write(image_response.content.get_bytes())Image to Text (Vision)
Analyze an image using a vision model. This uses the images domain, but the output modality is text.
from celeste.artifacts import ImageArtifact
# Load image
image = ImageArtifact(path="surreal_islands.png")
# Analyze (domain: images, output: text)
description = await celeste.images.analyze(
model="gpt-4o",
prompt="What colors are dominant in this image?",
image=image
)
print(description.content)Text to Speech
Read out generated text.
story = await celeste.text.generate(
model="gpt-4o",
prompt="Tell a very short story.",
)
audio = await celeste.audio.speak(
model="eleven_v3",
text=story.content,
voice="rachel"
)
with open("story.mp3", "wb") as f:
f.write(audio.content.get_bytes())