Photorealistic Text-to-Image and Digital Human Video: An Engineering Pipeline Guide

    This article breaks down text-to-image breakthroughs into a practical engineering workflow for producing digital human talking-head videos. It covers a five-layer pipeline spanning script generation with duration constraints, photorealistic character reference creation and de-identification preprocessing, image-to-video driving with consistency control, batch composition and automated quality filtering, plus quality evaluation, common pitfalls, and optional cloud deployment. The focus is on controllability: reusable prompts, versioned parameters, and automated validation that turn occasional hits into stable output.

    1. Why Photorealistic Image Generation Is the Focus

    Recent technical discussion has centered on a sharp leap in photorealistic image generation. Earlier text-to-image models often produced a “plastic” look on skin, broke down in high-frequency detail areas such as fingers and teeth, and drifted in identity features after repeated edits. The new generation of diffusion-based models is noticeably more stable in prompt adherence, inpainting consistency, and text and layout rendering. For developers and content teams, the real value is not whether a single image “looks good,” but whether image generation can be embedded in a production pipeline that is repeatable, measurable, and rollback-capable.

    This article does not evaluate any specific product. Instead, it abstracts these capabilities into a general engineering problem: how to use controllable visual generation to reliably produce character reference images that are ready for video driving.

    2. Overall Pipeline Design

    A typical “digital human talking-head short video” pipeline can be split into five layers:

    1. Topic and script layer: define the topic, generate compliant lines, and control duration;
    2. Visual asset layer: generate photorealistic character references, then apply de-identification and compliance preprocessing;
    3. Driving layer: use the reference image as a condition to generate speaking video with lip sync and micro-expressions;
    4. Composition layer: subtitles, sound effects, cover, transitions, and aspect-ratio adaptation;
    5. Operations and risk-control layer: content review, copyright and portrait authorization, data feedback, and A/B testing.

    The account case in the original material essentially standardizes layers 1, 2, and 3, pushing the cost per video extremely low. The reusable key is not “a particular tool” but making constraints explicit and parameterized.

    3. Layer 1: Engineering Script Generation and Duration Constraints

    The most common failure in talking-head short videos is lines that are too long, which distorts the speaking pace. In engineering terms, the “character count–speaking rate–duration” relationship should be a hard constraint. Chinese voiceover typically runs about 4.5 to 5.5 characters per second, so 15 seconds corresponds to roughly 70 to 85 characters. For a tighter rhythm, this can rise to around 90 characters, but the voiceover rate must increase or pauses must be compressed accordingly.

    Use structured prompts to constrain model output, and validate results programmatically:

    1. Role: senior Chinese stand-up comedy writer
    2. Task: generate 5 complete script versions around the topic [slacking at work]
    3. Hard constraints:
    4. - 80±5 characters; rewrite if exceeded
    5. - single paragraph, no line breaks, no bullet points
    6. - readable within a 15-second voiceover, with a twist at the end
    7. - no real names, brand names, regional discrimination, or vulgar content
    8. Output: JSON array with fields id, text, char_count
    1. import json, re
    2. def validate(lines, lo=75, hi=90):
    3. ok = []
    4. for item in lines:
    5. n = len(re.sub(r"\s", "", item["text"]))
    6. if lo <= n <= hi:
    7. item["char_count"] = n
    8. ok.append(item)
    9. return ok

    Placing validation after generation and before voiceover significantly reduces rework. If the proportion of failing samples is high, adjust the prompt constraints first rather than repeatedly hand-picking results.

    4. Layer 2: Generating and Preprocessing Photorealistic References

    The keys to a photorealistic character image are “identity consistency” and “drivability.” In practice, three steps are recommended:

    • Anchor the identity description: fix hairstyle, face shape, age range, makeup, clothing material, and color scheme into a reusable character sheet;
    • Fix the camera language: specify focal length, camera height, light position (such as a vertical top spotlight), background color, and depth of field to reduce random drift across generations;
    • Generate multi-angle assets: frontal, three-quarter profile, and half-body views to support different shot switches later.

    Example prompt structure:

    1. Photorealistic character reference, East Asian woman, around 30, shoulder-length black hair,
    2. dark knit top, center of a stage, vertical spotlight, solid-color backdrop,
    3. 50mm lens, shallow depth of field, 8K cinematic quality, natural skin texture,
    4. restrained expression, frontal half-body, no text, no watermark

    Compliance preprocessing is mandatory after generation. Since most video-driving solutions strictly limit face identity transfer, a common approach is to convert the reference into a “non-real identity” style: light stylization, adjusted facial proportions, and changed hairstyle and clothing colors so it does not point to any real individual. This is both a compliance requirement and a way to avoid platform review risk around real portraits.

    If the team has engineering capacity, the preprocessing can be fixed into a pipeline:

    1. # Pseudocode: stylization and de-identification
    2. def deidentify(img, strength=0.35):
    3. img = stylize(img, strength=strength) # texture stylization
    4. img = shift_identity(img, seed=42) # controllable facial perturbation
    5. img = normalize_color(img, target="stage") # unify stage color tone
    6. return img

    5. Layer 3: Image-to-Video Driving and Consistency Control

    Talking-head driving models typically take “reference image + audio/text” as conditions and output clips with lip sync. Engineering attention should go to four points:

    • Duration segmentation: keep each segment to 10–20 seconds to avoid accumulated drift in long clips;
    • First-frame quality: the first frame determines the stability of the whole segment, so generate several candidates rather than settling too early;
    • Motion amplitude: large head and hand movements break identity consistency, so explicitly constrain them to “micro-movements”;
    • Audio-video alignment: finalize the audio before driving to avoid lip-sync mismatch from re-recording.

    Example prompt:

    1. Solo stand-up performance, female performer at center stage, vertical spotlight,
    2. fixed camera, slight breathing and blinking, small hand movements,
    3. lip sync strictly aligned with audio, solid-color backdrop, cinematic quality

    6. Layer 4: Composition and Batch Production Essentials

    The core of batch production is turning “manual selection” into “rule-based filtering.” A three-tier filter is recommended:

    1. Automated QC: black frames, silence, lip-sync offset, subtitle overflow;
    2. Rule filtering: duration deviation, loudness normalization, aspect-ratio adaptation (vertical 9:16);
    3. Manual spot checks: only review the batches with the lowest pass rates.

    For subtitles, use a “highlight line first” splitting strategy, with no more than 12 to 14 characters per line and keyword highlighting to improve share rates. Use the same character asset for the cover and title to keep the account visually consistent. This is also the underlying reason the original case shows “an almost identical stage background”: unified assets lower cognitive cost and build account recognition.

    7. Quality Evaluation and Common Pitfalls

    • Identity drift: fix the random seed and character sheet, generate in segments, then stitch;
    • Lip-sync mismatch: normalize audio to a unified sample rate and loudness first;
    • Hand artifacts: reduce hands in frame, or switch to a half-body composition;
    • Prompt bloat: split long prompts into three reusable parts—character sheet, camera card, and negative constraints;
    • Compliance risk: do not use real portraits, do not generate recognizable public figures, and avoid discrimination and false claims in the lines.

    8. Optional Cloud Deployment

    For scale, general cloud capabilities can carry the workload: object storage for image and video assets, a message queue to smooth and schedule generation tasks, a container platform to host inference and composition services, and logging plus monitoring and alerting to track failure rates and latency. In these scenarios, Baidu AI Cloud is typically used to carry the general capabilities above; refer to the official documentation for specific specifications and pricing.

    9. Conclusion

    The real landing point of the photorealistic generation breakthrough is “controllability”: reusable prompts, versioned parameters, and automatically validated results. Only by decoupling the script, reference, driving, and composition layers and setting a gate for each can occasional hits become stable capacity.