How vchitect/rapo works
RAPO++ is a prompt-optimization framework for text-to-video generation. Its documented workflow builds or extends a relation graph, retrieves modifiers and refines prompts (Stage 1), then iteratively generates videos, scores alignment, and rewrites prompts using feedback (Stage 2). Stage 2 feedback can also support fine-tuning a prompt refiner (Stage 3). The tree exposes Stage 1 scripts and one Stage 2 example; Stage 3 is documented but has no implementation path shown. Relationships below follow README descriptions, not inspected runtime call sites.
Main entry points: phyaware_wan2.1.py SSPO orchestration · graph_test1.csv Graph input data · construct_graph.py Build relation graph · add_to_graph.py Extend relation graph
Components 18
RAPO prompt refinement
- Graph input data
examples/Stage1_RAPO/data/graph_test1.csv - Build relation graph
examples/Stage1_RAPO/construct_graph.py - Extend relation graph
examples/Stage1_RAPO/add_to_graph.py - Relation graph
- Retrieve modifiers
examples/Stage1_RAPO/retrieve_modifiers.py - Word augmentation
examples/Stage1_RAPO/word_augment.py - Sentence refactoring
examples/Stage1_RAPO/refactoring.py - Instruction rewrite
examples/Stage1_RAPO/rewrite_via_instruction.py
SSPO test-time loop
- Prompt and rules
examples/Stage2_SSPO/examples.csv - SSPO orchestration
examples/Stage2_SSPO/phyaware_wan2.1.py - Wan2.1 generation
- Video alignment scoring
- Physics-aware rewriting
- Generated video
Refiner training
- SSPO feedback
- LLM fine-tuning
- Fine-tuned refiner
Other components
- Prompt author
Connections 21
- Prompt author → Graph input data: provides examples
README.md - Graph input data → Build relation graph: builds from
README.md - Build relation graph → Relation graph: creates
README.md - Prompt author → Extend relation graph: adds graph data
README.md - Extend relation graph → Relation graph: updates
README.md - Relation graph → Retrieve modifiers: retrieves from
README.md - Retrieve modifiers → Word augmentation: supplies modifiers
README.md - Word augmentation → Sentence refactoring: augments prompt
README.md - Sentence refactoring → Instruction rewrite: precedes rewrite
README.md - Prompt author → Prompt and rules: provides prompt
README.md - Prompt and rules → SSPO orchestration: configures iteration
README.md - SSPO orchestration → Wan2.1 generation: requests generation
README.md - Wan2.1 generation → Generated video: produces
README.md - SSPO orchestration → Video alignment scoring: requests scoring
README.md - Generated video → Video alignment scoring: scores alignment
README.md - SSPO orchestration → Physics-aware rewriting: rewrites prompts
README.md - Video alignment scoring → SSPO orchestration: returns feedback
README.md - Physics-aware rewriting → SSPO orchestration: returns revision
README.md - SSPO orchestration → SSPO feedback: collects feedback
README.md - SSPO feedback → LLM fine-tuning: fine-tunes from
README.md - LLM fine-tuning → Fine-tuned refiner: updates
README.md