How alimama-creative/postermaker works
PosterMaker generates product posters by combining a supplied image, subject mask, prompt, and positioned text with an SD3 pipeline controlled for inpainting and text rendering. Its broader product scope includes staged model training, evaluation, and a reward-learning variant. The README documents these capabilities; sampled source confirms input preprocessing and key model components, while some training and inference wiring is supported only by the SOURCE INDEX.
Main entry points: train_sd3_stage2_with_reward.py Reward training · eval_utils.py Model evaluation · train_sd3_stage1.py Stage 1 training · train_sd3_stage2.py Stage 2 training
Components 18
Poster generation
- Inference entry
inference.py - Input preprocessing
utils/data_processor.py - SD3 pipeline
pipelines/pipeline_sd3.py - Generated posters
Generation models
- Text embeddings
models/text_embedder.py - ControlNet models
models/controlnet_sd3.py - SD3 transformer
models/transformer_sd3.py - Text adapter
models/adapter_models.py
Model training
- Stage 1 training
train_sd3_stage1.py - Stage 2 training
train_sd3_stage2.py - Reward training
train_sd3_stage2_with_reward.py
Data and evaluation
- Training dataset
data_utils/poster_dataset_e2e_train.py - Evaluation dataset
data_utils/poster_dataset_e2e_eval.py - Model evaluation
utils/eval_utils.py - Image and text utilities
utils/utils.py
Vision and recognition
- OCR recognizer
models/recognizer.py - SAM detection
detection_utils/inference.py
Other components
- Poster inputs
Connections 23
- Poster inputs → Inference entry: provides inputs
README.md - Inference entry → Input preprocessing: preprocesses
inference.py - Input preprocessing → Text embeddings: encodes text
utils/data_processor.py - Input preprocessing → Image and text utilities: uses image utilities
utils/data_processor.py - Inference entry → SD3 pipeline: runs generation
inference.py - SD3 pipeline → ControlNet models: applies controls
pipelines/pipeline_sd3.py - SD3 pipeline → SD3 transformer: denoises with
- SD3 pipeline → Generated posters: produces images
README.md - Stage 1 training → Training dataset: loads data
train_sd3_stage1.py - Stage 2 training → Training dataset: loads data
train_sd3_stage2.py - Reward training → Training dataset: loads data
train_sd3_stage2_with_reward.py - Stage 1 training → ControlNet models: trains model
train_sd3_stage1.py - Stage 2 training → ControlNet models: trains model
train_sd3_stage2.py - Reward training → ControlNet models: trains model
train_sd3_stage2_with_reward.py - Reward training → SAM detection: uses detection
train_sd3_stage2_with_reward.py - Stage 1 training → Model evaluation: evaluates with
train_sd3_stage1.py - Stage 2 training → Model evaluation: evaluates with
train_sd3_stage2.py - Reward training → Model evaluation: evaluates with
train_sd3_stage2_with_reward.py - Model evaluation → Evaluation dataset: loads samples
utils/eval_utils.py - Model evaluation → OCR recognizer: scores text
utils/eval_utils.py - Stage 1 training → Text adapter: configures
train_sd3_stage1.py - Stage 2 training → Text adapter: configures
train_sd3_stage2.py - Reward training → Text adapter: configures
train_sd3_stage2_with_reward.py