Choose the right training photos
Profile quality directly affects every edit and generation you run. Aim for – reference photos that cover a range of conditions:- Clear, well-lit faces — the subject’s face should be easy to see in every photo.
- High resolution — use 1K+ images. Avoid small crops, heavy compression, or noisy shots.
- Diverse expressions — include neutral, smiling, frowning, and surprised faces.
- Multiple angles — front-facing, slight left/right turns, and at least one profile view.
- Varied lighting — mix indoor, outdoor, sunny, and overcast conditions.
- Group shots are OK — as long as the intended subject’s face is clearly visible.
Scope profile_ids to the current end-user
The API only considers profiles for identify preservation that are explicitly included in each request.
It never silently matches against other profiles in your account — if you don’t pass any, no identity preservation is applied.
Your developer account holds profiles for all of your users, but each request should only include the profiles
belonging to the end-user whose photo is being processed.
Write descriptive prompts
The more specific your prompt, the better the result. Two principles help:- Say what to change. Be explicit about the transformation you want — pose, expression, background, style, lighting.
- Say what to keep. Tell the model what should stay the same so it doesn’t alter things you care about.
Use [[profile_id]] in prompts for generation and multi-person scenes
For edit and enhance requests, the profile_ids field tells the API which identities are available to draw from. The
[[profile_id]] prompt syntax helps referring to a specific subject in the input photo.
When you need it:
- Generation — the
/generateendpoint does not acceptprofile_ids. Inline[[...]]references in the prompt are the only way to specify which subjects to generate.
profile_ids alone is usually enough —
our system matches the face in the photo to the provided profiles automatically.
Use aspect ratio and resolution controls
You can setaspect_ratio and resolution on every edit and generate request.
Use these when:
- You need a specific aspect ratio (e.g.
9:16for stories,1:1for profile pictures). - You want 4K output resolution for higher detail.
Generate multiple variations
Output is non-deterministic — the same prompt can produce noticeably different results each time. Setnum_output_images to 2-4 and let the end-user pick the best one.
Debug identity issues with known_subjects
Every edit, generate, and enhance response includes a known_subjects field that reports which profiles our system
successfully recognized and rendered:
counts dict maps each profile_id to the number of times that subject appeared across all output images.
If a subject looks wrong in the output, check known_subjects first. If their profile_id is missing from
counts, our system could not figure out how to preserve that subject’s identity. This usually means:
- The profile was not included in
profile_ids(for edit/enhance) or not referenced with[[...]]in the prompt (for generate). - The subject in the input photo was difficult to recognize, e.g., due to occlusion, low resolution, or poor lighting.
- Too many profiles were passed in
profile_ids, making it harder for our system to match the right one. - The profile is still training (
IN_PROGRESS) or failed (ERROR).
profile_id is present in counts but the result still looks off, the issue is more likely prompt-related.
Try being more specific about the subject’s placement, or generate additional variations.
Next steps
Quickstart
Walk through the full workflow from authentication to your first edit.
Profiles guide
Deep-dive into profile creation, image requirements, and the [[profile_id]] syntax.
