Papers
Topics
Authors
Recent
Search
2000 character limit reached

Positional-aware Perceiver Resampler

Updated 17 November 2025
  • PPR is a specialized module that fuses facial and body embeddings to encode spatial and identity cues for multi-character image generation.
  • It employs dual Perceiver resamplers and a fusion MLP to distill high-dimensional features into compact tokens for targeted conditioning in diffusion pipelines.
  • The design enforces feature separation and uses attention-guided loss to maintain coherent character and background representations across image sequences.

The Positional-aware Perceiver Resampler (PPR) is a specialized module designed to extract and fuse both facial identity and full-body cues from reference images, enabling fine-grained, position-aware conditioning in diffusion-based generative models. PPR was introduced in the StoryMaker framework to address the challenge of creating multi-character, visually consistent image sequences, ensuring that individual character features—including face, clothing, hairstyle, and body—remain coherent across multiple generated images and narration steps (Zhou et al., 2024).

1. Functional Role within StoryMaker

PPR serves as the primary mechanism for integrating two types of reference-image features:

  • Facial identity embeddings (FfaceF_{\rm face}), sourced from a frozen ArcFace network, encapsulate the character’s facial traits.
  • Cropped character image embeddings (FcharF_{\rm char}), extracted using a frozen CLIP-ViT model, represent body appearance including attire and pose.

The module takes these two sets of high-dimensional features per character and distills them into a compact sequence of token embeddings cic_i. Each block of tokens within cic_i encodes one character’s holistic appearance; an additional block encodes background information. This token sequence is subsequently injected into the denoising U-Net of a Stable Diffusion–style pipeline via decoupled cross-attention, providing fine-grained, spatially targeted conditioning for multi-entity image synthesis.

2. Architectural Overview

PPR comprises the following main components:

  • Two Perceiver-style Resamplers (R1,R2)(R_1, R_2): Each resampler is independently applied to either FfaceF_{\rm face} or FcharF_{\rm char}, producing LL tokens of dimension DD for each feature set.
    • R1:Fface→E1∈RL×DR_1: F_{\rm face} \rightarrow E_1 \in \mathbb R^{L \times D}
    • FcharF_{\rm char}0
  • Feature Fusion Block (MLP): Concatenates FcharF_{\rm char}1 and FcharF_{\rm char}2, then merges them with a learnable positional embedding (FcharF_{\rm char}3) using a two-layer feedforward multilayer perceptron of hidden size FcharF_{\rm char}4.
  • Background Token Block (FcharF_{\rm char}5): A learnable block representing the background, isolated from all character tokens.
  • Token Sequence Construction:

    FcharF_{\rm char}6

    where each FcharF_{\rm char}7 is the fused representation for character FcharF_{\rm char}8.

These tokens serve as keys/values in the image-conditioned cross-attention mechanism for the diffusion model, enabling targeted influence of each character and background region.

Component Input Dimension Output Dimension
FcharF_{\rm char}9 (face) cic_i0 cic_i1
cic_i2 (body) cic_i3 cic_i4
Fusion MLP cic_i5 cic_i6
Background token — cic_i7
Final output (cic_i8) — cic_i9

3. Key Mathematical Formulation

The PPR computation is formalized as follows:

  • Perceiver Resamplers (per character):

    cic_i0

    where cic_i1, cic_i2, cic_i3.

    cic_i4

    where cic_i5, cic_i6.

  • Feature Fusion and Positional Encoding:

    cic_i7

    cic_i8

    where

    cic_i9

  • Concatenation with Background:

    (R1,R2)(R_1, R_2)0

  • Decoupled Cross-Attention Injection:

    (R1,R2)(R_1, R_2)1

    with (R1,R2)(R_1, R_2)2 constructed from (R1,R2)(R_1, R_2)3.

4. Separation of Features and Positional Consistency

To maintain distinctive per-character and background representations, the following strategies are enforced:

  • Each character block (R1,R2)(R_1, R_2)4 (for (R1,R2)(R_1, R_2)5) is maintained as a separate (R1,R2)(R_1, R_2)6-token group. The relative sequencing within each group is further disambiguated by the learnable positional embeddings (R1,R2)(R_1, R_2)7.
  • The first token block (R1,R2)(R_1, R_2)8 isolates background information. This architectural constraint ensures character features do not collapse into background features, preserving spatial locality and semantic consistency throughout generation.

This approach prevents the blending of character and background attributes during synthesis, supporting precise narrative and visual storytelling in multi-character scenes.

5. Attention-Guided Loss for Spatial Decoupling

To avoid feature bleeding across character and background regions, PPR uses a dedicated attention supervision loss:

  • For each image-conditioned cross-attention layer, compute attention maps:

    (R1,R2)(R_1, R_2)9

  • Aggregate each character’s FfaceF_{\rm face}0-token maps into a spatial map FfaceF_{\rm face}1.
  • Given segmentation masks FfaceF_{\rm face}2, the PPR-aware loss is:

    FfaceF_{\rm face}3

  • This loss is averaged across all FfaceF_{\rm face}4 cross-attention layers and combined with the primary diffusion loss:

    FfaceF_{\rm face}5

This loss enforces spatial decoupling, compelling each latent token block’s attention impact to correspond to its associated visual region.

6. Implementation and Hyper-parameters

Key specifications guiding PPR’s implementation in StoryMaker include:

  • Resampler Dimensions:
    • FfaceF_{\rm face}6: FfaceF_{\rm face}7 (ArcFace)
    • FfaceF_{\rm face}8: FfaceF_{\rm face}9 (CLIP-ViT-H/14, FcharF_{\rm char}0 typically 49 for FcharF_{\rm char}1 grid)
    • Latent dimension FcharF_{\rm char}2; tokens per block FcharF_{\rm char}3; up to FcharF_{\rm char}4 characters
    • Final FcharF_{\rm char}5 dimension for FcharF_{\rm char}6: FcharF_{\rm char}7
  • Attention and MLP:
    • 8 attention heads for FcharF_{\rm char}8 and FcharF_{\rm char}9
    • MLP hidden size LL0
  • Training Protocol:
    • LoRA rank: 128 (for all injected LL1, LL2, LL3)
    • Optimizer: AdamW; LL4 for first 4,000 steps, LL5 for last 4,000 steps; total 8,000 steps
    • Batch: 8 images × 8 A100 GPUs
    • Freeze SDXL U-Net and encoders, train PPR and LoRA adapters only
    • Inference: UniPC sampler with 25 steps, classifier-free guidance set to 7.5

This configuration ensures compute efficiency and controlled specialization of the resampler and cross-attention interface.

7. Significance in Multi-Character Image Generation

PPR’s design is central to StoryMaker’s capacity to render images with holistic character and scene consistency. By jointly leveraging facial and body cues, encoding positional information, and supervising spatial attention, PPR provides a principled solution for multi-entity composition in generative diffusion models. The architectural isolation of token groups and supervision with segmentation masks allows for scalable, tuning-free personalization without entanglement of extraneous features or characters, directly advancing the state of the art in narrative text-to-image tasks (Zhou et al., 2024).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Positional-aware Perceiver Resampler (PPR).