Human portrait
Pricing: Human portrait
No input image: describe a person by attributes (gender, age, nationality, body, face, hair, makeup, framing) and get photorealistic portraits of a new, made-up person: one to four per job on Qwen-Image 2.1, or one on MiniMax-H3-Image, which also renders 4K. The same job as a generation on www.happypony.io/human-portrait.
POST https://api.happypony.io/api/v1/jobs/human-portrait
GET https://api.happypony.io/api/v1/jobs/:requestId/status
GET https://api.happypony.io/api/v1/jobs/:requestId
PUT https://api.happypony.io/api/v1/jobs/:requestId/cancel
1) Create a request
POST https://api.happypony.io/api/v1/jobs/human-portrait with Content-Type: application/json. Every field is optional; {} is a valid request.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
gender, age, shot, nationality_1, … |
string | no | left to the model | Character attributes; the values each one takes are listed in Character values. age may also be a number. |
shot_weight |
number | no | 1.3 when shot is set |
How strongly shot is held: 1 (subtle), 1.3, 1.5 (strong), 1.8 (very strong). Only with shot. |
prompt_prefix |
string | no | none | Free text added to the prompt right after the subject (setting, clothing, light, style). Up to 1000 characters. Without it the portrait is shot in soft studio light on a neutral background. |
short_edge |
integer | no | 1080 |
Size of each image: 1080, 1440, 2048 (2K) or 4096 (4K). Pick it first: it decides which model values are allowed. At 2048 the image is 4 MP (2048x2048 at 1:1, 2720x1536 at 16:9); at 4096 it is 16 MP (4096x4096 at 1:1, 5472x3072 at 16:9). |
model |
string | no | "z-image-text-to-image", or "minimax-h3-image" when short_edge is 4096 |
The engine. "z-image-text-to-image" (Qwen-Image 2.1) renders short_edge 1080 to 2048; "minimax-h3-image" (MiniMax-H3-Image) renders 1080 to 4096. Any other combination is a 400. |
aspect_ratio |
string | no | "9:16" |
"16:9", "4:3", "1:1", "3:4", "9:16". |
num_images |
integer | no | 1 |
Different portraits from the same attributes: 1 to 4 with "z-image-text-to-image", exactly 1 with "minimax-h3-image". |
An attribute you leave out is decided by the model; it is not randomised. For variety across requests, pick the values yourself. nationality_2 blends a second nationality into the first, and beard applies to masculine subjects. The values must be spelled exactly as listed (they are case-sensitive); anything else is a 400.
Character values
| Field | Values |
|---|---|
gender |
Woman, Man |
age |
18, 20, 24, 28, 32, 36, 40, 44, 50, 56, 62, 70, 80 |
shot |
Head portrait, Head and shoulders portrait, Half-length portrait, Portrait, Full-length portrait, Full body, Close-up |
nationality_1, nationality_2 |
see the list below |
body_type |
Slim, Slight, Petite, Fit, Curvy, Voluptuous, Thick, Muscular, Buxom, Chubby, Plump, Stocky, Tall, Short |
breast_size |
flat, small, medium, large, huge |
butt_size |
small, medium, large, athletic |
skin_tone |
fair, medium, dark, olive, tan, bronzed, golden, porcelain, alabaster, ebony, chocolate, caramel, honey, peach, ivory, rose, sand |
skin_texture |
smooth, normal, dry, oily, combination, poreless, fine-textured, freckled, mole-covered, wrinkled, mature, youthful, dewy, matte, glowing, radiant |
face_shape |
Oval, Round, Square, Heart, Diamond, Oblong, Long, Triangle, Inverted Triangle, Pear, Rectangle |
jawline |
defined, soft, rounded, square, angular, sharp, delicate, strong, wide, narrow |
eyes_color |
Amber, Blue, Brown, Green, Gray, Hazel, Violet, Heterochromia |
eyes_shape |
Almond Eyes Shape, Asian Eyes Shape, Close-Set Eyes Shape, Deep Set Eyes Shape, Downturned Eyes Shape, Double Eyelid Eyes Shape, Hooded Eyes Shape, Monolid Eyes Shape, Oval Eyes Shape, Round Eyes Shape, Upturned Eyes Shape |
nose_shape |
straight, aquiline, roman, button, upturned, broad, narrow, small, large, sharp, rounded, angular, delicate, defined |
nose_size |
small, medium, large, wide, narrow, prominent, subtle, delicate |
hair_color |
Auburn, Black, Jet Black, Blonde, Strawberry, Chestnut, Chocolate, Caramel, Copper, Gray, Honey, Mahogany, Platinum, Red, Silver, White, Burgundy, Multicolored, Pastel |
hair_style |
Afro, Bald, Bangs, Bob, Blunt bob, Braided, Box braids, Bun, Top Knot, Buzz, Cornrows, Curly, Curly bob, Dreadlocks, Faux hawk, Layered, Long straight, Long ponytail, High ponytail, Mohawk, Pixie, Pompadour, Quiff, Shag, Short, Short curly, Side braid, Spiky, Undercut, Updo, Very long wave, Wavy, Wavy bob |
hair_length |
Short, Medium, Long |
beard |
Stubble Beard, Goatee, Full Beard, Van Dyke Beard, Soul Patch, Garibaldi Beard, Circle Beard, Corporate Beard, Balbo Beard, Ducktail Beard, Chinstrap Beard, Anchor Beard, Chevron Mustache, Horseshoe Mustache, Handlebar Mustache, Imperial Mustache, Pencil Mustache, Zappa Mustache |
makeup |
Natural Makeup, Glam Makeup, Glowy Makeup, Dewy Makeup, Classic Makeup, Cut Crease Makeup, Edgy Makeup, Festival Makeup, Golden Makeup, Monochromatic Makeup, Party Makeup, Retro Makeup, Smokey Eye Makeup, Sunset Eye Makeup, Vintage Makeup, Watercolor Makeup, Anime Makeup, Artistic Makeup, Avant-garde Makeup, Bohemian Makeup |
makeup_color |
Red, Pink, Coral, Peach, Mauve, Burgundy, Plum, Purple, Brown, Copper, Gold, Silver, Black, Wine, Raspberry, Orange, Nude, Berry |
Nationalities (nationality_1, nationality_2): Afghan, Albanian, Algerian, American, Andorran, Angolan, Argentine, Armenian, Australian, Austrian, Azerbaijani, Bahamian, Bahraini, Bangladeshi, Barbadian, Belarusian, Belgian, Belizean, Beninese, Bhutanese, Bolivian, Bosnian Herzegovinian, Brazilian, British, Bruneian, Bulgarian, Burkinabe, Burmese, Burundian, Cambodian, Cameroonian, Canadian, Cape Verdian, Central African, Chadian, Chilean, Chinese, Colombian, Comoran, Congolese, Costa Rican, Croatian, Cuban, Cypriot, Czech, Danish, Djibouti, Dominican, Dutch, East Timorese, Ecuadorean, Egyptian, Emirian, Equatorial Guinean, Eritrean, Estonian, Ethiopian, Fijian, Filipino, Finnish, French, Gabonese, Gambian, Georgian, German, Ghanaian, Greek, Grenadian, Guatemalan, Guinean, Guyanese, Haitian, Honduran, Hungarian, Icelander, Indian, Indonesian, Iranian, Iraqi, Irish, Israeli, Italian, Ivorian, Jamaican, Japanese, Jordanian, Kazakhstani, Kenyan, Korean, Kuwaiti, Kyrgyz, Laotian, Latvian, Lebanese, Liberian, Libyan, Lithuanian, Luxembourgish, Macedonian, Malagasy, Malawian, Malaysian, Maldivan, Malian, Maltese, Mauritanian, Mauritian, Mexican, Moldovan, Mongolian, Montenegrin, Moroccan, Mozambican, Namibian, Nepalese, New Zealander, Nicaraguan, Nigerian, North Korean, Norwegian, Omani, Pakistani, Palestinian, Panamanian, Paraguayan, Peruvian, Polish, Portuguese, Qatari, Romanian, Russian, Rwandan, Salvadoran, Samoan, Saudi, Scottish, Senegalese, Serbian, Singaporean, Slovakian, Slovenian, Somali, South African, South Korean, Spanish, Sri Lankan, Sudanese, Swazi, Swedish, Swiss, Syrian, Tajikistani, Tanzanian, Thai, Togolese, Tongan, Tunisian, Turkish, Turkmen, Ugandan, Ukrainian, Uruguayan, Uzbekistani, Venezuelan, Vietnamese, Welsh, Yemeni, Zambian, Zimbabwean.
Request body:
{
"gender": "Woman",
"age": 28,
"nationality_1": "Korean",
"shot": "Half-length portrait",
"hair_style": "Long straight",
"hair_color": "Black",
"makeup": "Natural Makeup",
"prompt_prefix": "Photo of a person in a cream knit sweater, soft window light.",
"aspect_ratio": "3:4",
"short_edge": 1080,
"num_images": 2
}
curl -X POST https://api.happypony.io/api/v1/jobs/human-portrait \
-H "Authorization: Bearer $HP_KEY" -H "Content-Type: application/json" \
-d '{"gender": "Woman", "age": 28, "nationality_1": "Korean", "shot": "Half-length portrait", "hair_style": "Long straight", "aspect_ratio": "3:4", "num_images": 2}'
Response 202 (fields: Create response):
{
"request_id": "48365",
"type": "human-portrait",
"status": "IN_QUEUE",
"credits": 6,
"status_url": "https://api.happypony.io/api/v1/jobs/48365/status",
"response_url": "https://api.happypony.io/api/v1/jobs/48365",
"cancel_url": "https://api.happypony.io/api/v1/jobs/48365/cancel"
}
2) Poll for status
Poll the status_url until status is COMPLETED, FAILED or CANCELLED (fields: Status response). A queued job can be cancelled with PUT on the cancel_url (Cancel a request).
curl https://api.happypony.io/api/v1/jobs/48365/status -H "Authorization: Bearer $HP_KEY"
{
"request_id": "48365",
"type": "human-portrait",
"status": "IN_PROGRESS",
"created_at": "2026-10-08T10:00:00.000Z",
"completed_at": null,
"credits": 6,
"status_url": "…", "response_url": "…", "cancel_url": "…"
}
3) Fetch the result
When status is COMPLETED, fetch the response_url (common fields: Result response):
curl https://api.happypony.io/api/v1/jobs/48365 -H "Authorization: Bearer $HP_KEY"
{
"request_id": "48365",
"type": "human-portrait",
"status": "COMPLETED",
"created_at": "2026-10-08T10:00:00.000Z",
"completed_at": "2026-10-08T10:00:52.000Z",
"credits": 6,
"images": [{ "url": "https://…signed…", "format": "png" }, { "url": "https://…signed…", "format": "png" }],
"expires_in": 259200,
"parameters": { "gender": "Woman", "age": "28", "shot": "Half-length portrait", "nationality_1": "Korean",
"hair_style": "Long straight", "shot_weight": 1.3, "prompt_prefix": null,
"model": "z-image-text-to-image", "aspect_ratio": "3:4", "short_edge": 1080, "num_images": 2 },
"status_url": "…", "response_url": "…", "cancel_url": "…"
}
| Field | Type | Description |
|---|---|---|
images |
object[] | One image per portrait (num_images). |
parameters |
object | The attributes you set (age as a string), shot_weight when there is a shot, prompt_prefix, model, aspect_ratio, short_edge and num_images. |
Full example
Create, poll until done, download:
curl (bash)
# Needs curl and jq. Usage: HP_KEY=hp_… ./portrait.sh
JOB=$(curl -s -X POST https://api.happypony.io/api/v1/jobs/human-portrait \
-H "Authorization: Bearer $HP_KEY" -H "Content-Type: application/json" \
-d '{"gender": "Man", "age": 36, "nationality_1": "Italian", "shot": "Head and shoulders portrait",
"beard": "Stubble Beard", "hair_style": "Quiff", "num_images": 2}')
echo "$JOB" | jq .
STATUS_URL=$(echo "$JOB" | jq -r .status_url)
RESPONSE_URL=$(echo "$JOB" | jq -r .response_url)
while :; do
STATUS=$(curl -s "$STATUS_URL" -H "Authorization: Bearer $HP_KEY" | jq -r .status)
[ "$STATUS" = IN_QUEUE ] || [ "$STATUS" = IN_PROGRESS ] || break
sleep 5
done
echo "$STATUS"
curl -s "$RESPONSE_URL" -H "Authorization: Bearer $HP_KEY" | jq -r '.images[] | "\(.format) \(.url)"' |
while read -r FORMAT URL; do curl -s -o "portrait-$((++i)).$FORMAT" "$URL"; done
Python
# pip install requests | HP_KEY=hp_… python portrait.py
import os, time, requests
BASE = "https://api.happypony.io/api/v1/jobs"
H = {"Authorization": f"Bearer {os.environ['HP_KEY']}"}
job = requests.post(f"{BASE}/human-portrait", headers=H, json={
"gender": "Woman",
"age": 28,
"nationality_1": "Korean",
"shot": "Half-length portrait",
"hair_style": "Long straight",
"prompt_prefix": "Photo of a person in a cream knit sweater, soft window light.",
"aspect_ratio": "3:4",
"num_images": 2,
})
job.raise_for_status()
job = job.json()
print("job", job["request_id"], "costs", job["credits"], "credits")
while (s := requests.get(job["status_url"], headers=H).json())["status"] in ("IN_QUEUE", "IN_PROGRESS"):
time.sleep(5)
result = requests.get(job["response_url"], headers=H).json()
if result["status"] != "COMPLETED":
raise SystemExit(f"{result['status']}: {result.get('error', '')}")
for i, image in enumerate(result["images"]):
with open(f"portrait-{job['request_id']}-{i}.{image['format']}", "wb") as f:
f.write(requests.get(image["url"]).content)