Image Generation
Tarsk’s AI agent can create and find images during conversations. Switch to Image mode in the chat mode selector for image-focused tasks, or ask the agent directly in Build mode.
Generating Images
Section titled “Generating Images”Ask the agent to create an image, and it will use the generate_image tool:
“Generate a hero image of a mountain landscape at sunset and save it to assets/hero.png”
The agent:
- Selects the first enabled image-capable model (or you can specify one)
- Sends the prompt to the image generation API
- Saves the resulting image to the file path you specified
- Returns the file path so you can reference it in your code
Supported Models
Section titled “Supported Models”Image generation requires a model that supports image output. When browsing models in Provider Settings, use the Tools filter to identify compatible models. Supported models include:
- DALL-E 3 (OpenAI)
- GPT Image 1 (OpenAI)
- OpenRouter image models (various providers)
- Any model listed with image generation capability
Saving Images
Section titled “Saving Images”Generated images are saved directly to your project directory. The save_to_file parameter specifies the relative path (e.g. assets/logo.png). Parent directories are created automatically.
If you want the media to appear directly in the conversation area, have the agent return the saved file path or a media URL plainly in its final response. The chat UI can render supported media inline.
Fallback: Stock Image Search
Section titled “Fallback: Stock Image Search”If no image models are enabled, the agent automatically falls back to searching for a stock photo matching your prompt. This provides a reasonable alternative without requiring additional API keys.
Finding Stock Images
Section titled “Finding Stock Images”You can also ask the agent to find an existing image instead of generating one:
“Find a stock photo of a team collaboration and save it to public/team.jpg”
The find_images tool searches a stock image API and returns matching results. You can specify the size:
| Size | Description |
|---|---|
original | Full resolution |
large2x | Extra large (2x) |
large | Large |
medium | Medium (default) |
small | Small |
portrait | Portrait orientation |
landscape | Landscape orientation |
tiny | Thumbnail size |
Image Clipboard and Save
Section titled “Image Clipboard and Save”Generated images in chat can be:
- Copied to clipboard — for pasting into design tools or documents
- Saved to a file — choose a destination path in the project
These options are available from the image preview actions in the chat.
Example Use Cases
Section titled “Example Use Cases”- App assets — “Generate an app icon with a blue gradient and white logo, save to public/icon.png”
- Documentation — “Find a diagram showing microservices architecture, save to docs/architecture.png”
- Marketing — “Generate a banner image for the landing page, save to assets/banner.jpg”
- Mockups — “Generate a mockup of a mobile app login screen, save to design/login-mockup.png”
- Be specific in your prompts for better results — describe colors, style, composition, and mood
- If generation fails, check that you have an image-capable model enabled in Settings
- Stock image search works without any API keys, making it a reliable fallback
- Always specify the
save_to_filepath so images end up in the right directory