Unlimited Open Source Models

Get Plan
Skip to main content
Imagen

AI Avatar API — Generate Avatars from a Selfie

Generate styled AI avatars from a single selfie with one POST request. Face identity stays, the style follows your prompt. Image plans from $21/month for 3,250 API calls.

What the AI Avatar API Does

One Selfie In, a Styled Avatar Out

The AI avatar API takes a single face photo and a text prompt and returns an image that keeps the identity of the face while rendering it in the style you describe — a studio headshot, an anime character, a 3D render, a comic panel. There is no template library to browse and no multi-photo training step; the face is read from the reference image at request time.

It runs on the same REST API and the same key as the rest of the ModelsLab image catalogue, so an avatar can be upscaled, relit, animated or lip-synced by passing its URL to the next endpoint.

What a Request Looks Like

POST https://modelslab.com/api/v6/image_editing/face_gen with `face_image` set to the selfie URL and `prompt` describing the style. Optional fields cover `negative_prompt`, `width`, `height`, `samples` (up to 2 per call), `seed` for reproducibility, a `style` preset (`realistic`, `anime`, `3d`, `comic`, `chibi`) and a `webhook` URL for async delivery.

  • Face identity preserved from one reference photo
  • Style controlled by prompt or the style preset
  • Up to 2 samples per request, optional width and height
  • Hosted image URLs in the response — no base64 handling
  • Seed parameter for repeatable results
  • Same key covers upscaling, relighting and video

AI Avatar API quick start

One POST to /api/v6/image_editing/face_gen with a selfie URL and a style prompt. Returns a hosted URL for the rendered avatar.

Python — generate an avatar from a selfie

Python
1import requests
2
3response = requests.post(
4 "https://modelslab.com/api/v6/image_editing/face_gen",
5 json={
6 "key": "YOUR_MODELSLAB_API_KEY",
7 "face_image": "https://example.com/selfie.jpg",
8 "prompt": "professional headshot, studio lighting, sharp focus",
9 "negative_prompt": "blurry, distorted, low quality",
10 "style": "realistic",
11 "width": 1024,
12 "height": 1024,
13 "samples": 1,
14 },
15)
16
17print(response.json()["output"][0])

JavaScript — anime avatar with a fixed seed

JavaScript
1const response = await fetch(
2 'https://modelslab.com/api/v6/image_editing/face_gen',
3 {
4 method: 'POST',
5 headers: { 'Content-Type': 'application/json' },
6 body: JSON.stringify({
7 key: 'YOUR_MODELSLAB_API_KEY',
8 face_image: 'https://example.com/selfie.jpg',
9 prompt: 'anime avatar, cel shading, soft studio light',
10 style: 'anime',
11 seed: 42,
12 samples: 1,
13 }),
14 },
15);
16
17const data = await response.json();
18console.log(data.output[0]);

cURL — quick test from the terminal

bash
1curl -X POST 'https://modelslab.com/api/v6/image_editing/face_gen' \
2 -H 'Content-Type: application/json' \
3 -d '{
4 "key": "YOUR_MODELSLAB_API_KEY",
5 "face_image": "https://example.com/selfie.jpg",
6 "prompt": "corporate portrait, neutral background",
7 "style": "realistic",
8 "samples": 1
9 }'

Avatar Endpoints on the Same Key

face_gen is the avatar endpoint. The neighbours below cover the steps before and after it.

EndpointWhat it doesTypical use
POST /api/v6/image_editing/face_genStyled avatar from one selfieProfile pictures, characters, headshots
POST /api/v6/image_editing/head_shotSame endpoint, headshot-oriented aliasCorporate and team headshots
POST /api/v6/image_editing/super_resolutionUpscale the avatarPrint and large-format use
POST /api/v7/video-fusion/image-to-videoAnimate the avatarIntro clips, social loops
POST /api/v7/video-fusion/lip-syncMake the avatar speak an audio trackTalking-head explainers

Every endpoint accepts and returns hosted image URLs, so the output of one is the input of the next.

Ship Avatars in 3 Steps

From API key to a styled avatar in one request.

STEP 01
STEP 01

Step 1: Get Your API Key

Create a ModelsLab account, subscribe to an image plan from $21/month for 3,250 API calls, and copy your key from the dashboard.

STEP 02
STEP 02

Step 2: Send the Selfie and a Style Prompt

POST to /api/v6/image_editing/face_gen with face_image set to a hosted selfie URL and prompt describing the look. A straight-on, well-lit photo gives the most faithful identity.

STEP 03
STEP 03

Step 3: Use, Upscale or Animate the Result

The response carries a hosted image URL. Serve it directly, upscale it with super_resolution, or pass it to image-to-video or lip-sync to make the avatar move and speak.

Consistent Characters Across Many Images

face_gen is the fastest route to one avatar from one photo. When a product needs the same character across dozens of scenes — a game, a brand mascot, a virtual presenter — train a LoRA on a small photo set instead and generate from that model with the text-to-image endpoint. Both paths run on the same plan and key; the difference is setup time against consistency.

Pricing

Image plans start at $21/month for 3,250 API calls and $47/month for 10,000. Avatar generation on self-hosted models is one call per image and is covered by the plan. The $149/month Open Source Unlimited plan removes the per-call limit on the open-weight image models ModelsLab self-hosts. There is no separate avatar fee.

Why Developers Use the ModelsLab Avatar API

Key advantages that set us apart

One selfie in, styled avatar out — no training step
Face identity preserved, style set by prompt
Five style presets: realistic, anime, 3D, comic, chibi
Hosted image URLs back in seconds
Seed parameter for repeatable output
Chain to upscale, relight, animate or lip sync
Image plans from $21/month for 3,250 calls
One API key across image, video, speech and LLM

Our Popular Use Cases

What teams build with the AI avatar API:

Offer a generated avatar during onboarding from the photo the user already uploaded. One request per style option.

Profile Pictures at Sign-Up

AI Avatar API FAQ

POST https://modelslab.com/api/v6/image_editing/face_gen with face_image set to a selfie URL and prompt describing the style. The response carries a hosted URL for the avatar, or an id to fetch when the request is queued.

Image plans start at $21/month for 3,250 API calls and $47/month for 10,000. Avatar generation on self-hosted models costs one call per image and is covered by your plan.

Any style you can describe in the prompt, plus five presets: realistic, anime, 3D, comic and chibi. Face identity is kept from the reference selfie while the style follows the prompt.

No. face_gen works from a single selfie. For a fixed character across many images, train a LoRA on a small photo set and generate avatars from that model instead.

ModelsLab is a paid service. Image plans start at $21/month for 3,250 API calls. Creating an account is free, but generating avatars requires an active plan.

Yes. Pass the avatar URL to /api/v7/video-fusion/image-to-video to animate it, or to /api/v7/video-fusion/lip-sync with an audio track to make it speak. All of it runs on the same API key.

Your Data is Secure: GDPR Compliant AI Services

ModelsLab GDPR Compliance Certification Badge

GDPR Compliant

AI Image API Pricing Starting at $0.0047 Per Image

ModelsLab offers subscription plans from $21/month (Basic) and $47/month (Standard, 10,000 API calls) to $149/month (Open Source Unlimited). All plans include access to Flux, SDXL, Stable Diffusion 3, and 10,000+ community models. Choose a paid plan, cancel anytime, 100% refund policy.

Coming Soon

We are making some changes to our pricing, please check back later.

Get Expert Support in Seconds

We're Here to Help.

Want to know more? You can email us anytime at support@modelslab.com

View Docs

POST https://modelslab.com/api/v6/image_editing/face_gen with `face_image` set to a selfie URL and `prompt` describing the style. The response carries a hosted URL for the avatar, or an id to fetch when the request is queued.

Image plans start at $21/month for 3,250 API calls and $47/month for 10,000. Avatar generation on self-hosted models costs one call per image and is covered by your plan.

Any style you can describe in the prompt: realistic headshots, anime, 3D render, illustration, pixel art. Face identity is kept from the reference selfie while the style follows the prompt.

No. face_gen works from a single selfie. For a fixed character across many images, train a LoRA on a small photo set instead and generate avatars from that model.

ModelsLab is a paid service. Image plans start at $21/month for 3,250 API calls. Creating an account is free, but generating avatars requires an active plan.

Yes. Pass the avatar URL to /api/v7/video-fusion/image-to-video to animate it, or to /api/v7/video-fusion/lip-sync with an audio track to make it speak. All of it runs on the same API key.
Plugins

Explore Plugins for Pro

Our plugins are designed to work with the most popular content creation software.

API

Build Apps with
ML
API

Use our API to build apps, generate AI art, create videos, and produce audio with ease.