Image Generation
TF Design includes built-in image generation via the ToothFairyAI backend. No API keys or credentials are required — the models are available through your ToothFairyAI workspace and consume UoI.
Available Models
| Model | Alias | Strength |
|---|---|---|
| Mystica SD | mystica_sd | Stable diffusion — versatile, good for general imagery |
| Mystica Realism SD | mystica_realism_sd | Photorealistic — high-fidelity, realistic results |
| Sorcerer Canvas | sorcerer_canvas | Compositional — strong layout and scene control |
| Sorcerer Vision | sorcerer_vision | Vision-aware — contextual, detail-rich |
| Mystica Vision | mystica_vision | Balanced — quality and speed trade-off |
How It Works
- The agent or user requests an image via a media-generation prompt.
- The Desktop app dispatches the request to the ToothFairyAI backend.
- The model generates the image and returns it as a
.pngfile. - The output is saved to the project workspace and appears as a download chip.
- The image can be referenced in the artifact or downloaded directly.
Prompt Templates
TF Design ships with prompt templates accessible from the Image Templates tab on the entry view. These cover common use cases:
| Category | Examples |
|---|---|
| Product imagery | Hero shots, product mockups, device renders |
| Backgrounds | Gradients, textures, abstract patterns |
| Social media | Instagram posts, LinkedIn banners, Twitter headers |
| Editorial | Magazine covers, article headers, infographic elements |
| Brand assets | Logos, icon sets, brand illustrations |
Using a Prompt Template
- Open the Image Templates tab.
- Browse templates by category.
- Click a template to open the preview modal.
- Customise the prompt and generate.
Model Configuration
Configure default media models in the Settings dialog:
- Open Settings (gear icon).
- Navigate to Media Providers.
- Select a default image model from the dropdown.
- Models are synced automatically within the Desktop app when you change them in Settings.
The selected model is used for all image generation unless overridden per-request.
Using Generated Images in Artifacts
Generated images are saved to the project workspace and can be:
- Referenced in HTML —
<img src="assets/generated-image.png">. - Used as backgrounds —
background-image: url('assets/generated-image.png'). - Downloaded — click the download chip to save locally.
- Reused — images persist in the project directory and are included in ZIP exports.
Internal Endpoints
The following endpoints are exposed by the running Desktop app's embedded runtime for in-app tools and the agent:
| Endpoint | Method | Description |
|---|---|---|
/api/media/models | GET | List available media models |
/api/media/config | GET / PUT | Get or set media provider configuration |
/api/projects/:id/media/generate | POST | Generate media for a project |
/api/projects/:id/media/tasks | GET | List media tasks for a project |
/api/media/tasks/:id/wait | GET | Wait for a media task to complete |