AI Engagement Photos Docs

AI Features Overview

Engagement portraits powered by Kie.ai, with legacy Volcano Engine demos.

Overview

The production portrait flow uses Kie.ai GPT Image 2. The bundled chat and video demos retain their original Volcano Engine integrations:

FeatureModelEndpoint
Chat demodoubao-1-5-thinking-pro-250415/api/chat/stream
Engagement portraitsgpt-image-2-image-to-image/api/image/generate
Video demodoubao-seedance-1-0-pro-250528/api/video/generate

Configuration

Production portrait generation requires Kie.ai:

IMAGE_PROVIDER="kie"
KIE_API_KEY="your-kie-api-key"
KIE_IMAGE_MODEL="gpt-image-2-image-to-image"

The legacy chat and video demos require Volcano Engine:

VOLCANO_ENGINE_API_KEY="your-api-key"
VOLCANO_ENGINE_API_URL="https://ark.cn-beijing.volces.com/api/v3"

Architecture

Provider wrappers are split by product ownership:

lib/image-providers/  # Production engagement image providers
lib/volcano-engine/   # Legacy chat, image, and video demo wrappers

Credit Integration

Every AI operation follows the deduct-first, refund-on-failure pattern:

  1. Check if user has enough credits
  2. Deduct credits from balance
  3. Call AI API
  4. If API fails, refund credits automatically

Replacing the AI Provider

To switch the production image provider:

  1. Add or replace the adapter in lib/image-providers/
  2. Update environment variables
  3. Adjust model configuration
  4. Keep the same credit deduction pattern

On this page