remyxai/story-diffusion-flux-modular
StoryDiffusion for FLUX — training-free consistent-character generation (Modular Diffusers custom block)
Generate a set of frames of the same character across different scenes — no fine-tuning — as a Modular Diffusers custom block. Implements StoryDiffusion's Consistent Self-Attention (arXiv:2405.01434) on FLUX: each frame also attends to the other frames, so the character stays consistent while the scenes vary. Optional comic-sheet layout. Training-free.
 — make a consistent-character comic from your prompts.
<sub>One character (prompt) across Morning / Coffee / Afternoon / Evening scenes — consistent identity, distinct scenes. Training-free.</sub>
Usage
import torch
from diffusers import ModularPipeline
pipe = ModularPipeline.from_pretrained("remyxai/story-diffusion-flux-modular", trust_remote_code=True)
pipe.load_components(dtype=torch.bfloat16)
pipe.to("cuda")
out = pipe(
character_prompt="a young woman with curly red hair and freckles, green jacket",
scene_prompts=[
"waking up in a sunlit bedroom #Morning", # "#..." -> panel caption
"drinking coffee in a cozy kitchen #Coffee",
"walking through a city park #Afternoon",
"reading in a warm cafe at night #Evening", # "[NC] ..." -> a scene without the character
],
comic_layout="grid", comic_cols=2,
height=1024, width=1024,
).images
sheet, panels = out[0], out[1:] # comic_layout -> images[0] is the composed sheet
sheet.save("comic.png")How it works
The frames are generated together with a Consistent Self-Attention processor: each frame keeps its own tokens and additionally attends to a sampled fraction (share_ratio=0.3) of the other frames' tokens, but only after the first ~third of steps (share_start_frac=0.35) — so each scene's composition is set first, then the shared character is locked in. This keeps scenes distinct while the character stays consistent. The base weights are untouched (restored after). Scope: image consistency + comic compositor (no video; PhotoMaker real-face identity is a possible v2 that pairs with `remyxai/pulid-flux-modular`).
Key parameters
Attribution & AI assistance
FLUX (MMDiT) port of StoryDiffusion's Consistent Self-Attention (HVision-NKU/StoryDiffusion, Apache-2.0). Authored with AI assistance (Claude) and validated by the Remyx AI team. Uses FLUX.1-dev under its non-commercial license.
Citation
@misc{zhou2024storydiffusion,
title={StoryDiffusion: Consistent Self-Attention for Long-Range Image and Video Generation},
author={Zhou, Yupeng and Zhou, Daquan and Cheng, Ming-Ming and Feng, Jiashi and Hou, Qibin},
year={2024}, eprint={2405.01434}, archivePrefix={arXiv}, primaryClass={cs.CV},
url={https://arxiv.org/abs/2405.01434}
}