Create from Image

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

Upload Your Image

POST/v1/upload

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

POST/v1/collections

Pass the uploaded image URL as a reference to create a collection. If you omit the name field, the API auto-detects the character name from the image using AI vision.

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_image_urls": [
      "https://api.masko.ai/v1/uploads/uploaded_mascot.png"
    ]
  }'

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

POST/v1/collections/:id/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/col_abc123/references \
  -H "Authorization: Bearer masko_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://api.masko.ai/v1/uploads/ref_side_view.png"
  }'

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