π persona generation system for M4 Mac with ComfyUI, LoRA training, and comprehensive validation. Create realistic digital personas with unique trigger words that can be combined in scenes.
- Apple Silicon Mac (M1/M2/M3/M4)
- 16GB+ RAM recommended
- 50GB+ free disk space
- macOS 13.0+
- Python 3.10+
# Clone the repository
git clone <repository-url> persona
cd persona
# Make scripts executable
chmod +x setup.sh scripts/*.sh
# Run complete automated setup (takes 10-15 minutes)
./setup.shWhat setup.sh does:
- Creates Python virtual environment
- Installs PyTorch with MPS support
- Clones ComfyUI and sd-scripts
- Installs all dependencies
- Sets up custom nodes (WAS Node Suite, AnimateDiff, etc.)
# Download all required models (SDXL, VAE, AnimateDiff, ControlNet)
./scripts/download_models.shDownloads (~15GB):
- SDXL Base 1.0 + Refiner
- SDXL VAE
- AnimateDiff motion model
- ControlNet OpenPose
- RealESRGAN upscaling models
# Start ComfyUI server
./scripts/run_comfyui.sh
# Or manually:
cd ComfyUI && python main.py --port 8188Access ComfyUI: Open http://127.0.0.1:8188
# Test system setup
python test_setup.pyExpected output:
β
Virtual environment: Active
β
PyTorch MPS: Available
β
ComfyUI: Installed
β
sd-scripts: Installed
β
Models: Downloaded
β
WAS Node Suite: 220 nodes loaded
β
System ready for persona generation!
# Create new persona
python scripts/persona_manager.py add --name "Sarah Miller"
# Creates: persona-sarah_miller (trigger word: persona-sarah_miller)Required folder structure:
reference_images/persona1/
βββ face_reference/ (8 required images)
β βββ front_face_clear.jpg (Direct frontal, eyes/nose/mouth visible)
β βββ face_3quarter_left.jpg (3/4 profile, ear visible)
β βββ face_3quarter_right.jpg (3/4 profile, ear visible)
β βββ face_profile_left.jpg (Full side profile)
β βββ face_profile_right.jpg (Full side profile)
β βββ eyes_closeup.jpg (Detailed eye region)
β βββ smile_expression.jpg (Natural smile)
β βββ neutral_expression.jpg (Relaxed expression)
βββ body_reference/ (7 required images)
βββ body_front_full.jpg (Front view, full body)
βββ body_back_full.jpg (Back view, full body)
βββ body_left_side.jpg (Left profile, full body)
βββ body_right_side.jpg (Right profile, full body)
βββ sitting_pose.jpg (Natural sitting)
βββ walking_pose.jpg (Mid-stride movement)
βββ hands_detail.jpg (Clear hand reference)
Image Requirements:
- Resolution: 1024x1024+ (faces), 1024x1536+ (bodies)
- Quality: Sharp focus, natural lighting
- Background: Plain or simple preferred
- Format: JPG, PNG, or WEBP
# Process reference images for training
python scripts/prepare_training_data.py --persona-id persona-sarah_miller# Train persona LoRA (takes 30-60 minutes)
./scripts/train_lora.sh persona-sarah_miller
# Monitor training progress
tail -f logs/persona-sarah_miller_training.log- Open ComfyUI (http://127.0.0.1:8188)
- Load Workflow: Menu β Load β
ADAPTIVE_BATCH_COMMUNITY_GENERATOR.json - Configure LoRA: Set
PERSONA1_LORA.safetensorstopersona-sarah_miller.safetensors - Update Prompts: Replace
PERSONA1_TRIGGERwithpersona-sarah_miller - Queue Prompt to generate!
The ADAPTIVE_BATCH_COMMUNITY_GENERATOR.json workflow includes:
- 3 persona slots with individual LoRA loaders
- Adaptive generation based on active personas
- Batch reference image loading (20-30 images per persona)
- Face cropping + 4x upscaling for detailed inspection
- Edge detection analysis for anatomical consistency
- AI-powered image analysis for quality assessment
- Reference comparison against training images
- 3 additional LoRAs:
realistic_skin_texture.safetensors(0.6 strength)detail_enhancer.safetensors(0.4 strength)photorealism_helper.safetensors(0.5 strength)
- Single Portrait: Individual character headshots
- Duo Portrait: Two characters interacting
- Group Photo: All three characters together
- Conversation Scene: Natural dialogue poses
- Outdoor Scene: Environmental interactions
- Video Generation: AnimateDiff motion sequences
- Original Images:
ADAPTIVE_[SCENE_TYPE] - Validation Crops:
VALIDATION_[SCENE]_FACE_4X - Edge Analysis:
EDGE_ANALYSIS_[SCENE] - Upscaled Versions:
ADAPTIVE_[SCENE]_4X
- Start ComfyUI:
./scripts/run_comfyui.sh - Access Interface: http://127.0.0.1:8188
- Load Workflow: Menu β Load β
ADAPTIVE_BATCH_COMMUNITY_GENERATOR.json
For Single Persona:
- Load reference images in
reference_images/persona1/ - Set
PERSONA1_LORA.safetensorsto your trained LoRA - Update prompts with your trigger word
- Set other persona LoRA strengths to 0
For Multiple Personas:
- Load reference images in
persona1/,persona2/,persona3/folders - Configure each LoRA loader with respective
.safetensorsfiles - Update all prompts with appropriate trigger words
- Adjust LoRA strengths (0.6-0.8 range for multi-persona)
- Queue Prompt β Workflow begins processing
- Monitor Progress β Watch node execution in real-time
- Review Outputs β Check generated images in ComfyUI output folder
- Validation Check β Examine cropped faces and edge analysis
- Quality Assessment β Compare against reference images
ComfyUI/output/
βββ ADAPTIVE_SINGLE_PORTRAIT_00001_.png
βββ ADAPTIVE_DUO_PORTRAIT_00002_.png
βββ ADAPTIVE_GROUP_PHOTO_00003_.png
βββ VALIDATION_SINGLE_FACE_4X_00004_.png
βββ EDGE_ANALYSIS_SINGLE_00005_.png
βββ [Additional outputs...]
# Create optimized training config
python scripts/create_optimized_config.py --persona-id persona-sarah_miller
# Train with custom settings
./scripts/train_lora_with_config.sh configs/persona-sarah_miller_optimized.toml# Test different LoRA strengths
python scripts/test_lora_strengths.py --persona-id persona-sarah_miller --strengths "0.6,0.7,0.8,0.9"
# Enhanced caption generation
python scripts/generate_captions.py --persona-id persona-sarah_miller --mode detailed# List all personas
python scripts/persona_manager.py list
# Get persona details
python scripts/persona_manager.py info persona-sarah_miller
# Create multi-persona workflow
python scripts/persona_manager.py generate-workflow persona-sarah_miller persona-john_doe \
--prompt "two people having coffee" \
--output workflows/sarah_and_john.jsonmasterpiece, persona-sarah_miller wearing elegant dress, professional portrait,
natural lighting, detailed facial features, high quality photography
cinematic photo, persona-sarah_miller on the left talking with persona-john_doe on the right,
modern office setting, natural conversation, professional lighting, bokeh background
ultra realistic, persona-sarah_miller and persona-john_doe,
detailed faces, natural skin texture, perfect anatomy,
professional photography, 85mm lens, shallow depth of field,
avoid: cartoon, anime, artificial, plastic, duplicate faces
- π How to Use Personas - Complete usage guide
- π Multi-Persona Guide - Advanced multi-character techniques
- ποΈ Master Workflow Guide - UI controls and features
- π§ Improving Quality - Optimization techniques
Workflow won't load:
# Restart ComfyUI to clear cache
./scripts/restart_comfyui.shMissing nodes error:
# Reinstall WAS Node Suite dependencies
cd ComfyUI/custom_nodes/was-node-suite-comfyui
pip install -r requirements.txtOut of memory during training:
# Edit training config for lower memory usage
# Reduce batch_size to 1, lower resolution to 768Poor generation quality:
- Check reference image quality (sharp, well-lit)
- Increase training steps (6000-8000)
- Adjust LoRA strength (0.7-0.9 for single, 0.6-0.7 for multi)
- Use detailed prompts with negative prompts
For M4 Max/Ultra:
- Increase batch size to 2-4
- Use higher resolution training (1024x1024)
- Enable gradient accumulation
For M4 Base:
- Keep batch size at 1
- Use 768x768 training resolution
- Enable gradient checkpointing
Minimum:
- M1 Mac with 16GB RAM
- 50GB free disk space
- macOS 13.0+
Recommended:
- M4 Mac with 32GB+ RAM
- 100GB+ free disk space (for multiple personas)
- macOS 14.0+
Optimal:
- M4 Max/Ultra with 64GB+ RAM
- 200GB+ SSD space
- External GPU enclosure (optional)
# Update dependencies
pip install --upgrade -r requirements.txt
# Update ComfyUI
cd ComfyUI && git pull
# Update custom nodes
cd custom_nodes/was-node-suite-comfyui && git pull
# Backup personas and models
tar -czf personas_backup.tar.gz personas.json models/loras/ reference_images/For issues, questions, or feature requests:
- Check the troubleshooting section above
- Review the documentation in
docs/ - Examine log files in
logs/directory - Test with the validation workflow first
The system is designed to be completely self-contained and idempotent - you can run setup multiple times safely, and all components work together seamlessly for professional persona generation.