Create from Image

Upload your existing mascot design and let the API auto-detect the character.

Upload Your Image

You can upload an image either as a multipart form upload or by providing a URL to an existing image.

Multipart Upload

curl -X POST https://api.masko.ai/v1/upload \
  -H "Authorization: Bearer masko_YOUR_API_KEY" \
  -F "file=@mascot.png"

URL Upload

curl -X POST https://api.masko.ai/v1/upload \
  -H "Authorization: Bearer masko_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/my-mascot.png" }'

Create Collection

Pass the asset_id from the upload step as a reference. You don't need to provide a prompt - the image itself is the reference, and the API extracts the character description automatically. If you omit name, it's also auto-detected from the image.

curl -X POST https://api.masko.ai/v1/collections \
  -H "Authorization: Bearer masko_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "PROJECT_ID",
    "reference_asset_ids": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]
  }'
Tip

You can also pass reference_image_urls with public URLs instead of uploading first. Both work - use reference_asset_ids for uploaded files, reference_image_urls for external URLs.

How Auto-Analysis Works

When you create a collection from an image, Masko uses AI vision to analyze the reference and extract a character name and detailed prompt. This analysis is free and happens automatically. The extracted prompt describes the character's visual traits so future generations stay consistent.

Adding More References

You can add up to 6 reference images to a collection. More references means better consistency across generated poses.

curl -X POST https://api.masko.ai/v1/collections/COLLECTION_ID/references \
  -H "Authorization: Bearer masko_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "asset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }'

You can also pass a url instead of asset_id if you have a public image URL.

When references change, the style card is cleared and will be re-extracted on the next generation to reflect the updated visual direction.

Best Practices

  • Use 3-4 reference images showing different angles for best consistency
  • Keep a consistent art style across all references - don't mix 3D and flat vector
  • Use high-resolution images (1024x1024 or larger recommended)
  • White or transparent backgrounds work best - the AI focuses on the character, not the scene