#3 Self-approved and unit tests passed with flying colors. Co-authored-by: Sagnik <sagnik7896@gmail.com> Reviewed-on: #5
Dream Weaver Automation Scripts
This directory contains Python automation scripts for the Dream Weaver interior restyling workflow.
Scripts Overview
1. dreamweaver_batch_processor.py
Main batch processing controller for automated image restyling.
Features:
- Directory monitoring for automatic job queueing
- Automatic mask caching for improved performance
- Queue management with status tracking
- Support for all three processing phases
- WebSocket integration with ComfyUI for real-time status
Usage:
# Process single image
python dreamweaver_batch_processor.py --input image.jpg --style scandinavian_minimalist --phase 1
# Process all images in directory
python dreamweaver_batch_processor.py --batch --style art_deco_luxe --phase 2
# Start directory monitoring mode
python dreamweaver_batch_processor.py --monitor
2. mask_preprocessor.py
Utility for preprocessing and caching segmentation masks.
Features:
- Offline mask generation and caching
- Mask refinement (grow, feather, invert)
- Multi-region mask support (walls, floor, ceiling)
- Batch preprocessing for entire directories
- Cache management and statistics
Usage:
# Preprocess single image
python mask_preprocessor.py --image image.jpg
# Preprocess entire directory
python mask_preprocessor.py --directory ../test_inputs/
# Show cache statistics
python mask_preprocessor.py --stats
# Clear all cached masks
python mask_preprocessor.py --clear-cache
# Custom mask parameters
python mask_preprocessor.py --image image.jpg --grow 5 --feather 8
Configuration
Scripts use configuration from CONFIG dictionary in each file. Key settings:
comfyui_server: ComfyUI HTTP endpoint (default: http://localhost:8188)comfyui_ws: ComfyUI WebSocket endpoint (default: ws://localhost:8188/ws)input_directory: Default input images directoryoutput_directory: Generated images output directorycache_directory: Mask cache storage locationbatch_size: Number of images to process in batch (Phase 3)
Integration with ComfyUI
These scripts require ComfyUI to be running with the Dream Weaver workflows loaded.
Starting ComfyUI:
cd Project_Velocity/comfy_engine
python main.py --fp16 --lowvram
For Production (Dual RTX PRO 6000):
python main.py --bf16 --highvram --xformers --gpu-batch-size 8
Workflow Files
Scripts reference these workflow JSON files:
workflows/dreamweaver_phase1_depth.json- Single ControlNet (RTX 3080Ti)workflows/dreamweaver_phase2_multicontrol.json- Multi-ControlNet (RTX 3080Ti)workflows/dreamweaver_phase3_batch.json- Batch processing (Dual RTX PRO 6000)
Style Templates
Available style templates (located in ../prompts/):
scandinavian_minimalist- Light, airy Nordic designart_deco_luxe- Glamorous 1920s aestheticcyberpunk_neon- High-tech futuristicbiophilic_organic- Nature-connected sustainablejapandi_fusion- Japanese-Scandinavian blend
Dependencies
Install required packages:
pip install -r ../requirements.txt
Logging
Scripts output logs to:
- Console (real-time)
dreamweaver_batch.log(file)
Log level can be adjusted in script logging.basicConfig() calls.
Hardware Requirements
Phase 1 & 2 (Development):
- NVIDIA RTX 3080Ti (12GB VRAM)
- 32GB System RAM
- SSD Storage
Phase 3 (Production):
- Dual NVIDIA RTX PRO 6000 Blackwell (96GB VRAM each)
- 128GB System RAM
- NVMe SSD Storage
- NVLink enabled for GPU memory pooling
API Reference
ComfyUI Endpoints Used
POST /prompt- Submit workflow to queueGET /queue- Get queue statusWS /ws- WebSocket for real-time updates
Job Status Values
pending- Waiting in queueprocessing- Currently generatingcompleted- Successfully finishedfailed- Error occurred
Troubleshooting
Connection Refused Error:
- Ensure ComfyUI is running
- Check server URL in configuration
- Verify firewall settings
Out of Memory:
- Reduce batch size
- Lower resolution
- Enable tiled VAE decoding
Mask Cache Issues:
- Clear cache:
python mask_preprocessor.py --clear-cache - Check cache directory permissions
- Verify available disk space
Development
To extend functionality:
- Modify
BatchProcessorclass for new processing logic - Add new style templates in
../prompts/ - Update workflow JSON files for new ControlNet configurations
Support
For issues related to:
- Scripts: Check logs in
dreamweaver_batch.log - ComfyUI: Refer to ComfyUI documentation
- Workflows: See technical specification in
../docs/DREAMWEAVER_TECHNICAL_SPEC.md