Example Workflows - Pixel3DMM ComfyUI Nodes
This directory contains example ComfyUI workflows demonstrating various use cases for the Pixel3DMM nodes.
📁 Available Examples
1. basic_reconstruction.json
Purpose: Simple 3D face reconstruction from a single image
Workflow:
Load Image → Pixel3DMM Loader → Face Reconstructor 3D → Preview + Export
Features:
- Quick setup for beginners
- Balanced quality settings
- Basic mesh export to OBJ format
- Estimated time: 30-60 seconds
Use Cases:
- Quick prototyping
- Learning the basic workflow
- Simple 3D avatar creation
2. advanced_optimization.json
Purpose: High-quality reconstruction with multi-constraint optimization
Workflow:
Load Image → Pixel3DMM Loader → Face Reconstructor 3D
↓
UV Predictor + Normal Predictor → FLAME Optimizer → Export
Features:
- High-quality reconstruction
- UV and normal constraint optimization
- Professional mesh export with textures
- Estimated time: 2-5 minutes
Use Cases:
- Professional 3D modeling
- High-quality avatar creation
- Research and development
🚀 How to Use Examples
Method 1: Direct Import
- Open ComfyUI
- Drag and drop the JSON file into the ComfyUI interface
- Configure paths (model files, input images, output directories)
- Queue the workflow
Method 2: Load via Menu
- Open ComfyUI
- Click "Load" in the menu
- Navigate to the examples directory
- Select the desired JSON file
- Configure and run
⚙️ Configuration Requirements
Required Files
Before running the examples, ensure you have:
-
Model Files:
models/pixel3dmm/pixel3dmm_model.pthmodels/flame/FLAME2020/generic_model.pklmodels/flame/FLAME_masks.pkl
-
Input Images:
- Place test images in
input/directory - Supported formats: JPG, PNG, WEBP
- Recommended resolution: 512x512 or higher
- Place test images in
-
Output Directories:
output/meshes/(for exported 3D models)output/images/(for rendered previews)
Path Configuration
Update these paths in the workflows:
// Model path in Pixel3DMMLoader
"model_path": "models/pixel3dmm/pixel3dmm_model.pth"
// Input image in LoadImage
"image": "your_face_photo.jpg"
// Output directory in MeshExporter
"output_directory": "output/meshes"
🎛️ Customization Options
Quality Settings
Fast Mode (30 seconds):
"reconstruction_quality": "fast",
"optimize_flame": false,
"optimization_steps": 50
Balanced Mode (1-2 minutes):
"reconstruction_quality": "balanced",
"optimize_flame": true,
"optimization_steps": 100
High Quality Mode (3-5 minutes):
"reconstruction_quality": "high",
"optimize_flame": true,
"optimization_steps": 200
Device Configuration
Auto Detection:
"device": "auto",
"precision": "fp32"
GPU Optimized:
"device": "cuda",
"precision": "fp16"
CPU Only:
"device": "cpu",
"precision": "fp32"
Export Options
Basic OBJ Export:
"output_format": "obj",
"include_textures": false,
"scale_factor": 1.0
Professional Export with Textures:
"output_format": "obj",
"include_textures": true,
"scale_factor": 1.0,
"center_mesh": true
🔧 Troubleshooting Examples
Common Issues
❌ "Model file not found"
Solution: Update the model path in Pixel3DMMLoader:
"model_path": "/full/path/to/pixel3dmm_model.pth"
❌ "Input image not found"
Solution: Update the image path in LoadImage:
"image": "/full/path/to/your_image.jpg"
❌ "Output directory not found"
Solution: Create the directory or update the path:
mkdir -p output/meshes
❌ "CUDA out of memory"
Solutions:
- Switch to CPU mode
- Use FP16 precision
- Reduce optimization steps
- Use "fast" quality setting
Performance Tips
- GPU Usage: Always use GPU when available
- Batch Processing: Process multiple images in sequence
- Memory Management: Close other applications
- Quality vs Speed: Choose appropriate quality settings
📚 Learning Path
Beginner
- Start with
basic_reconstruction.json - Try different input images
- Experiment with quality settings
- Learn the basic node connections
Intermediate
- Use
advanced_optimization.json - Understand UV and normal prediction
- Experiment with optimization parameters
- Try different export formats
Advanced
- Create custom workflows
- Combine with other ComfyUI nodes
- Implement batch processing
- Develop custom configurations
🎯 Best Practices
Input Images
- Resolution: 512x512 minimum, 1024x1024 optimal
- Quality: High-quality, well-lit face photos
- Pose: Frontal or near-frontal face orientation
- Background: Clean, uncluttered backgrounds work best
Workflow Organization
- Group nodes logically (Input, Processing, Output)
- Use descriptive names for saved workflows
- Document custom settings in workflow descriptions
- Save intermediate results for debugging
Performance Optimization
- Use appropriate quality settings for your use case
- Monitor GPU memory usage during processing
- Save frequently to avoid losing work
- Test with small images before processing large batches
🤝 Contributing Examples
We welcome community contributions of example workflows!
Submission Guidelines
- Test thoroughly before submitting
- Include documentation explaining the workflow
- Use descriptive filenames and node names
- Provide sample input/output when possible
Example Categories
- Basic workflows for beginners
- Advanced techniques for professionals
- Specialized use cases (animation, batch processing, etc.)
- Integration examples with other ComfyUI nodes
📞 Support
If you have questions about the examples:
- Check the main README.md for general information
- Review the troubleshooting section above
- Open an issue on GitHub with your specific question
- Join our Discord for community support
Happy 3D reconstructing! 🎉
These examples should get you started with creating amazing 3D face models using Pixel3DMM in ComfyUI.