Examples
Image Input + Output
Hackathon Resources
- Introduction
- Setup
- Examples
- Simple Text Agent
- Agent with Tools
- Agent with Knowledge
- Agent with Structured Outputs
- Research Agent
- YouTube Agent
- Image Input + Tools
- Image Generation using DALL-E
- Image to Structured Output
- Image Generate Audio
- Image Input + Output
- Image Transcription
- Image search using Giphy
- Audio Input
- Audio Input Output
- Audio Sentiment
- Audio Transcript
- Audio Multi Turn
- Audio Generate Podcast
- Video Input
- Video Generation with Models Lab
- Video Generation with Replicate
- Video Captions
- Video to Shorts
- Models
- Pre-built Replit Template
- 🏆 Prizes
Examples
Image Input + Output
Image to Image
This agent takes an image input and responds with an image output.
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.fal import FalTools
agent = Agent(
model=OpenAIChat(id="gpt-4o"),
agent_id="image-to-image",
name="Image to Image Agent",
tools=[FalTools()],
markdown=True,
debug_mode=True,
show_tool_calls=True,
instructions=[
"You have to use the `image_to_image` tool to generate the image.",
"You are an AI agent that can generate images using the Fal AI API.",
"You will be given a prompt and an image URL.",
"You have to return the image URL as provided, don't convert it to markdown or anything else.",
],
)
agent.print_response(
"a cat dressed as a wizard with a background of a mystic forest. Make it look like 'https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png'",
stream=True,
)
Usage
1
Install libraries
pip install -U agno openai
2
Export API keys
export OPENAI_API_KEY=***
export FAL_API_KEY=***
3
Run the agent
python image_input_output.py
On this page