A general-purpose pipeline for generating webcomic-style images from stick figure pose definitions.
- Define a minimal stick figure skeleton (graph of joints + bones)
- Specify poses as joint angles (forward kinematics)
- Render skeletons to conditioning images
- Use ControlNet to generate styled comic characters from skeletons
- Composite characters into panel layouts with text/dialogue
The core idea: separate POSE (what the character is doing) from STYLE (how it looks). Pose is a tiny parameter space (~10 angles). Style is handled by the diffusion model + LoRA fine-tune.
pip install diffusers transformers accelerate torch torchvision
pip install pillow numpypython pose_detector.py render --torso 0 --l-shoulder 20 --r-shoulder -20 --out pose.pngpython pose_detector.py generate-data --output-dir ./training_data --num-samples 1000JointType: Enum for joint typesJoint: Dataclass for joint positionsBodyProportions: Dataclass for body measurementsPose: Dataclass for pose anglesSkeletonSolver: Converts poses to joint positionsSkeletonRenderer: Renders skeletons to imagesComicGenerator: Uses ControlNet to generate styled charactersCompositor: Assembles panels with characters and text
MIT License