CharacterFactory: Sampling Consistent Characters With GANs for Diffusion Models

Qinghe Wang, Baolu Li, Xiaomin Li, Bing Cao, Liqian Ma, Huchuan Lu, Xu Jia

TL;DR

CharacterFactory is a novel framework that allows for the "end-to-end" sampling of infinite, brand-new characters with consistent identities for diffusion models. By training a lightweight GAN to map a latent space to the celebrity embedding space of CLIP, it enables the generation of identity-consistent images in just seconds, without requiring reference images or time-consuming per-subject fine-tuning.

What Problem Does This Paper Address?

While text-to-image diffusion models like Stable Diffusion are incredibly powerful, they struggle with identity consistency. If you ask a model to generate "a person" in five different scenes, you will likely get five different-looking people.

Existing solutions generally fall into two camps:

  1. Optimization-based (e.g., DreamBooth, Textual Inversion): These require a set of reference images and a lengthy fine-tuning process for every new character you want to create.
  2. Encoder-based (e.g., IP-Adapter, PhotoMaker): these use image encoders to "inject" a reference person into a scene, but they often struggle to maintain fine details or inadvertently leak the style and pose of the reference image.

The authors identify a "missing middle": a way to sample a new character that doesn't exist yet and ensure they look the same across any prompt, all without needing a reference photo or a 20-minute training session for every new "person."

Methods

The core innovation is the Identity-Embedding GAN (IDE-GAN). Instead of generating pixels, this GAN operates entirely within the CLIP text embedding space.

  • Learning from Celebs: The authors observed that Stable Diffusion already "knows" how to keep identities consistent for famous people because it was trained on their names. They take the word embeddings of 326 celebrity names as "ground truth" data.
  • The GAN Architecture: A simple MLP-based generator learns to map a random noise vector ($z$) to a pseudo-word embedding that mimics the distribution of real celebrity embeddings. A discriminator is trained to distinguish these "fake" identities from real celeb embeddings.
  • Context-Consistent Loss: To ensure the character doesn't just look consistent in a vacuum, the authors designed a loss function using 1,000 ChatGPT-generated prompts. This forces the model to ensure that the contextual embedding (the output of the CLIP text transformer) remains stable regardless of whether the character is "wearing a spacesuit" or "reading a book."
  • AdaIN Integration: They use Adaptive Instance Normalization (AdaIN) to help the generated embeddings land more naturally within the high-dimensional manifold of human identity.

Crucially, the diffusion model's U-Net remains frozen. The "factory" is just a mapping tool that plugs into the existing CLIP text encoder.

Datasets

  • Training Data: Word embeddings of 326 celebrity names (first and last names) extracted from the CLIP-ViT-L/14 tokenizer.
  • Contextual Prompts: 1,000 diverse text prompts generated by ChatGPT covering various expressions, decorations, actions, and backgrounds.
  • Evaluation: The authors used 70 generated identities across 40 text prompts (2,800 images total) to compare against baselines.

Key Insights and Ideas

  • The Embedding Manifold: The paper treats "identity" as a continuous manifold in the embedding space. Because they use a GAN, they can interpolate between characters. If you have character A and character B, you can sample a point halfway between their latent vectors to get a consistent "child" or hybrid character.
  • Efficiency is King: Because the GAN only trains on small vectors (not images), the entire "factory" can be trained in just 10 minutes on a single A100 GPU. Once trained, creating a new, consistent character takes only 3 seconds.
  • Leveraging Priors: Rather than trying to teach the model what a face looks like from scratch, CharacterFactory "hijacks" the existing human-centric priors already baked into CLIP and Stable Diffusion.

Key Results

  • Quantitative Superiority: CharacterFactory outperformed baselines like DreamBooth, Textual Inversion, and IP-Adapter in Identity Consistency (measured by face similarity) and Editability (how well the character follows the prompt).
  • Speed: It is orders of magnitude faster than optimization-based methods. While DreamBooth takes ~1500 seconds to learn a character, CharacterFactory does it in 3 seconds.
  • Cross-Modal Compatibility: Because the output is a standard CLIP embedding, it works seamlessly with other "plug-and-play" modules. The authors demonstrated consistent characters in:
  • Video: Using ModelScopeT2V.
  • 3D: Using LucidDreamer.
  • Controllable Image Gen: Using ControlNet (OpenPose).

Limitations and Future Work

  • Base Model Constraints: Since the U-Net is fixed, CharacterFactory inherits any flaws of the base Stable Diffusion model, such as the infamous "bad hands" or difficulty with complex anatomy.
  • Suboptimal Embeddings: Occasionally, the GAN may sample a point in the latent space that produces a "suboptimal" embedding, leading to slight identity shifts or lower image quality.
  • Diversity vs. Quality: There is a trade-off between the diversity of generated identities and the consistency of those identities. While the model can generate different races and genders, the authors suggest "Stratified Sampling" (training separate GANs for different categories) as a way to improve results further.

Summary updated

BibTeX
@article{wang2025characterfactory,
  author = {Qinghe Wang and Baolu Li and Xiaomin Li and Bing Cao and Liqian Ma and Huchuan Lu and Xu Jia},
  title = {{CharacterFactory: Sampling Consistent Characters With GANs for Diffusion Models}},
  journal = {IEEE Trans. Image Process.},
  year = {2025},
  doi = {10.1109/tip.2025.3558668},
}
Figure