ComfyUI Extension: ComfyUI-DiT360

Authored by cedarconnor

Created

Updated

0 stars

Generate high-fidelity 360-degree panoramic images using the DiT360 diffusion transformer model in ComfyUI.

Custom Nodes (0)

    README

    NOT WORKING YET!!!!!

    ComfyUI-DiT360

    360Β° Panorama Generation Enhancement Nodes for ComfyUI

    Generate seamless equirectangular panoramic images using FLUX.1-dev with the DiT360 LoRA adapter.


    🌟 Features

    • βœ… Circular Padding: Seamless wraparound at panorama edges
    • βœ… 2:1 Aspect Ratio Enforcement: Automatic equirectangular format
    • βœ… Edge Blending: Perfect continuity at boundaries
    • βœ… Interactive 360Β° Viewer: Three.js-based panorama navigation
    • βœ… Geometric Losses: Yaw loss (rotational consistency) & Cube loss (pole distortion reduction)

    πŸ“¦ What is This?

    DiT360 is a LoRA adapter (~2-5GB) for FLUX.1-dev that enables high-quality 360Β° panorama generation. This node pack provides enhancement nodes that add the necessary circular padding and post-processing to make panoramas seamless.

    This is NOT a full model loaderβ€”you use standard ComfyUI nodes to load FLUX and apply the DiT360 LoRA, then use our enhancement nodes for 360Β° specific features.


    πŸš€ Installation

    1. Install ComfyUI

    If you haven't already, install ComfyUI.

    2. Clone This Repository

    cd ComfyUI/custom_nodes
    git clone https://github.com/yourusername/ComfyUI-DiT360.git
    cd ComfyUI-DiT360
    pip install -r requirements.txt
    

    3. Download Models

    • FLUX.1-dev: Place in ComfyUI/models/checkpoints/ Download from Hugging Face

    • DiT360 LoRA: Place in ComfyUI/models/loras/ Download from Hugging Face

    4. Restart ComfyUI

    python main.py
    

    You should see: βœ… ComfyUI-DiT360 v2.0.0 loaded


    πŸ“– Usage

    Basic Workflow

    1. Load Checkpoint β†’ Select FLUX.1-dev (standard node)
    2. Load LoRA β†’ Select dit360.safetensors, strength 1.0 (standard node)
    3. CLIP Text Encode β†’ Enter your prompt (standard node)
    4. Equirect360EmptyLatent β†’ Creates 2048Γ—1024 latent (our node)
    5. Equirect360KSampler β†’ Sample with circular padding (our node)
    6. Equirect360VAEDecode β†’ Decode with circular padding (our node)
    7. Equirect360EdgeBlender β†’ Blend edges for perfect wraparound (our node)
    8. Equirect360Viewer β†’ Interactive 360Β° preview (our node, coming soon)
    9. Save Image β†’ Standard save (standard node)

    Example Workflow

    See examples/basic_workflow.json (coming soon)


    🎨 Node Descriptions

    1. Equirect360EmptyLatent

    Creates empty latent with enforced 2:1 aspect ratio.

    • Input: Width (e.g., 2048), Batch size
    • Output: Latent (auto-calculated height = width/2)
    • Use instead of: EmptyLatentImage

    2. Equirect360KSampler

    Standard KSampler with circular padding for seamless edges.

    • Inputs: Model, conditioning, latent, sampler settings
    • Key Parameter: circular_padding (16-32 recommended)
    • Optional Geometric Losses:
      • enable_yaw_loss + yaw_loss_weight (0.05-0.2) - Ensures rotational consistency, ~2x slower
      • enable_cube_loss + cube_loss_weight (0.05-0.2) - Reduces pole distortion, ~1.5x slower
    • Use instead of: KSampler

    Note: Geometric losses improve quality but increase generation time. Start with just circular padding, then add losses if you need extra quality.

    3. Equirect360VAEDecode

    VAE decode with circular padding for smooth edges.

    • Inputs: Samples (latent), VAE, circular_padding
    • Use instead of: VAEDecode

    4. Equirect360EdgeBlender

    Post-processing to ensure perfect wraparound.

    • Inputs: Image, blend_width (10-20 px), blend_mode (cosine/linear/smooth)
    • Highly recommended for best results!

    5. Equirect360Viewer (coming soon)

    Interactive Three.js viewer for 360Β° navigation.

    • Input: Image
    • Features: Mouse drag, scroll zoom, fullscreen

    πŸ’‘ Prompting Tips

    Describe the full 360Β° environment in your prompts:

    Good Examples:

    "A cozy mountain cabin interior, large windows showing snowy peaks,
    warm fireplace, wooden furniture, morning light, 360 degree panorama"
    
    "Standing in a futuristic city plaza, skyscrapers all around,
    neon signs, rain-slicked streets, night time, cyberpunk, 360 panorama"
    
    "Ancient library with towering bookshelves on all sides, spiral staircases,
    warm lighting from chandeliers, dusty atmosphere, 360 degree view"
    

    βš™οΈ System Requirements

    Minimum

    • GPU: NVIDIA with 12GB VRAM (RTX 3060 12GB, 3080, 4070)
    • RAM: 16GB system memory
    • Storage: 30GB free space (FLUX + LoRA)
    • OS: Windows 10/11 or Linux

    Recommended

    • GPU: NVIDIA with 16GB+ VRAM (RTX 4080, 4090)
    • RAM: 32GB system memory
    • Storage: 50GB NVMe SSD

    Resolution Guide

    | Resolution | VRAM | Speed | Quality | |-------------|-------|--------|-------------| | 1024Γ—512 | 12GB | Fast | Good | | 2048Γ—1024 | 16GB | Medium | Excellent | | 4096Γ—2048 | 24GB+ | Slow | Outstanding |


    πŸ› Troubleshooting

    Visible Seam at Edges

    • Solution: Increase circular_padding to 24-32
    • Solution: Increase blend_width to 20+
    • Solution: Enable enable_yaw_loss (slower)

    Out of Memory

    • Solution: Lower resolution (1024Γ—512)
    • Solution: Use fp8 precision for FLUX
    • Solution: Disable yaw/cube losses

    Not Seamless in Viewer

    • Check: DiT360 LoRA is loaded and strength = 1.0
    • Check: circular_padding > 0
    • Check: Using Equirect360EdgeBlender

    πŸ“š Documentation


    πŸ—ΊοΈ Roadmap

    v2.0.0 (Current - Complete!)

    • [x] Documentation cleanup
    • [x] Core utilities (circular padding, edge blending)
    • [x] 5 clean nodes
    • [x] Three.js 360Β° viewer
    • [x] Example workflows
    • [x] Yaw loss (rotational consistency)
    • [x] Cube loss (pole distortion reduction)

    v2.1.0 (Future)

    • [ ] ControlNet integration
    • [ ] Inpainting support
    • [ ] Img2img workflow improvements
    • [ ] Advanced loss visualization

    v2.2.0 (Future)

    • [ ] Performance optimizations (xFormers, attention slicing)
    • [ ] Batch generation support
    • [ ] Video panorama generation
    • [ ] Custom loss functions API

    πŸ“„ License

    Apache License 2.0

    Models:

    • FLUX.1-dev: Subject to Black Forest Labs license
    • DiT360 LoRA: Subject to Insta360 Research license

    πŸ™ Credits


    🀝 Contributing

    Contributions welcome! Please:

    1. Fork the repository
    2. Create a feature branch
    3. Submit a pull request

    πŸ“ž Support


    ⭐ If you find this useful, please star the repository!