Props
A prop is an object your mascot reuses across images, such as a mug, a phone or a book. Masko keeps it as a clean drawing, the object alone on white in the mascot's style, and adds it to a new image when the request mentions that kind of object. A mascot or a variant holds up to 12 props.
Add a prop from a picture
Send any picture that shows the object. It can be messy: a hand holding the object, a busy scene, a photo or a frame of a video. Upload it first with POST /v1/upload and send its asset_id as image_asset_id, or send the ID of one of the mascot's images.
description says which object to take when the picture shows several, and becomes the prop's description. Without it, Masko takes the main object it finds. name is optional too.
There is no confirmation step: Masko finds the objects, takes the one you described, saves it and starts its clean drawing. It costs 1 credit, refunded if the drawing fails.
curl -X POST https://api.masko.ai/v1/mascots/MASCOT_ID/props \
-H "Authorization: Bearer masko_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_asset_id": "UPLOADED_ASSET_ID",
"description": "the hot-pink phone with a small fish on the back",
"name": "Pink phone"
}'Poll poll_url until the job is completed, usually under a minute. Then list the props to see the drawing.
| Error | When |
|---|---|
404 no_prop_found | The picture shows no object besides the mascot. |
404 no_matching_prop | The description names none of the objects found. details.found lists them; describe one of those. |
409 prop_exists | The object is already one of the mascot's props. |
409 | The mascot or variant already has 12 props. |
402 insufficient_credits | Not enough credits for the drawing. |
429 | 60 pictures searched for objects in one day. |
Add the prop to a variant instead of the mascot with variant_id.
List props
curl https://api.masko.ai/v1/mascots/MASCOT_ID/props \
-H "Authorization: Bearer masko_YOUR_API_KEY"Each prop has its status and, once completed, an image_url: a signed link to the drawing that expires, so list again for a fresh one. Pass variant_id for a variant's props.
How props reach new images
You never attach a prop by hand. When you generate an image, including a canvas pose, Masko checks each prop's use_when against the request and adds up to three props the request mentions, by any name for that kind of object. "Holding her phone up, giggling" brings the pink phone; "waving hello" brings nothing.
Animations do not add props. An animation shows a prop when the pose it starts from holds it, so generate the pose with the prop first and animate from it.
