Skip to main content

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

ModelAliasStrength
Mystica SDmystica_sdStable diffusion — versatile, good for general imagery
Mystica Realism SDmystica_realism_sdPhotorealistic — high-fidelity, realistic results
Sorcerer Canvassorcerer_canvasCompositional — strong layout and scene control
Sorcerer Visionsorcerer_visionVision-aware — contextual, detail-rich
Mystica Visionmystica_visionBalanced — quality and speed trade-off

How It Works

  1. The agent or user requests an image via a media-generation prompt.
  2. The Desktop app dispatches the request to the ToothFairyAI backend.
  3. The model generates the image and returns it as a .png file.
  4. The output is saved to the project workspace and appears as a download chip.
  5. 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:

CategoryExamples
Product imageryHero shots, product mockups, device renders
BackgroundsGradients, textures, abstract patterns
Social mediaInstagram posts, LinkedIn banners, Twitter headers
EditorialMagazine covers, article headers, infographic elements
Brand assetsLogos, icon sets, brand illustrations

Using a Prompt Template

  1. Open the Image Templates tab.
  2. Browse templates by category.
  3. Click a template to open the preview modal.
  4. 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 backgroundsbackground-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:

EndpointMethodDescription
/api/media/modelsGETList available media models
/api/media/configGET / PUTGet or set media provider configuration
/api/projects/:id/media/generatePOSTGenerate media for a project
/api/projects/:id/media/tasksGETList media tasks for a project
/api/media/tasks/:id/waitGETWait for a media task to complete