360° KSampler
The sampler that makes the left edge agree with the right edge
- model
- positive
- negative
- latent_image
- LATENT
This is the heart of the pack: a drop-in KSampler that makes the diffusion model think about the wrap-around while it's sampling, instead of hoping the seam fixes itself afterward. For 360° work it replaces your normal KSampler and adds circular padding plus, optionally, two geometric losses designed to keep the panorama consistent as a sphere.
Everything a KSampler has, it has: model, seed, steps (default 20), cfg (default 3.5), sampler_name (default euler), scheduler (default simple), positive, negative, latent_image, denoise. Respect those defaults. FLUX is a guidance-distilled model where euler + simple and a guidance around 3–5 is the well-trodden path - the wrong sampler/scheduler on FLUX gives muddy, blurry results, and too much guidance gives harsh contrast and blown highlights.
Then the 360° additions:
circular_padding(default 16, 0–128) - the core trick. Before each denoise step the latent is padded in the X direction with a wrapped copy of itself, the model predicts, and the padding is stripped off. The model literally sees the right edge's context while generating the left edge, so the two sides learn to match. The pack suggests starting at 0 and adding 8–16 (up to 32) only if you see a seam, since padding costs VRAM and time.enable_yaw_loss(default off) - rotational consistency. It rotates the current denoised estimate (x0) by several yaw angles and penalizes disagreement, nudging the sample toward "looks the same when you turn around." Costs roughly 2× time.yaw_loss_weight(default 0.1) - the 0.05–0.2 range is what the pack recommends; too high and it over-constrains and kills detail.enable_cube_loss(default off) - pole distortion. It reprojects the latent to a cubemap and back, punishing the smearing you get at the poles of an equirectangular image. Roughly 1.5× slower.cube_loss_weight(default 0.1) - same 0.05–0.2 range; increase slowly if the poles still look melted.
Under the hood it clones your model before wrapping it, so it doesn't pollute other nodes in the graph - good hygiene that a stock KSampler won't give you. Output is a LATENT, wired into 360° VAE Decode.
Install
ComfyUI Manager (search "ComfyUI-DiT360"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/cedarconnor/ComfyUI-DiT360
cd ComfyUI-DiT360
pip install -r requirements.txt
then restart. Requirements are numpy and Pillow - already in ComfyUI. Models: FLUX.1-dev in models/checkpoints, DiT360 LoRA (~2–5GB) from Insta360-Research on Hugging Face in models/loras, applied at strength 1.0.
Where people get burned
- Turning both losses on right away. Start with padding only. The losses are research-grade features, expensive, and the pack itself treats them as optional polish for a stubborn seam - not daily settings.
- Cranking
circular_paddingto 128 because more must be better. It doesn't; it eats VRAM and slows every step. 32 is already a lot. - Ignoring the sampler defaults. This is the classic FLUX failure mode, and this node's defaults (euler/simple, guidance 3.5) are the right answer - lower guidance is a common tweak, not higher.
- Out of memory → lower the resolution in 360° Empty Latent or disable the losses, per the pack's troubleshooting.
Honest take: the padding is the reason this node exists and it's the one genuinely useful switch. The geometric losses are where it gets experimental - fun to A/B test, but treat them as a last resort rather than part of the daily workflow.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | Connect your diffusion MODEL (e.g., FLUX UNet + DiT360 LoRA). | |
| seed | INT | 00–18446744073709550000 | Noise seed. Use a fixed value for reproducible results; use randomize/increment to explore variations. |
| steps | INT | 201–10000 | Diffusion steps. Recommended: ~20. Increase (30-50) for more detail; decrease for speed. |
| cfg | FLOAT | 3.50–100 | Classifier-free guidance. Recommended: ~3-5 for FLUX. Too high can cause harsh contrast or blown highlights. |
| sampler_name | COMBO | Sampler algorithm. Recommended: euler. Change only if you know what you prefer. | |
| scheduler | COMBO | Step scheduler. Recommended: simple (FLUX default). | |
| positive | CONDITIONING | Positive prompt conditioning. | |
| negative | CONDITIONING | Negative prompt conditioning. | |
| latent_image | LATENT | Starting latent. Use 360° Empty Latent for text2img, or a latent from img2img. | |
| denoise | FLOAT | 1.000–1 | Denoise strength. Recommended: 1.0 for text2img; <1.0 for img2img to preserve structure. |
| circular_padding | INT | 160–128 | Latent-space circular padding on X for seam reduction. Recommended: start at 0; if seam, try 8-16 (up to 32). Higher values cost VRAM/time. |
| enable_yaw_loss | BOOLEAN | false | Yaw-rotation consistency loss during sampling. Use if the panorama changes noticeably when yaw-rotated; ~2x slower. |
| yaw_loss_weight | FLOAT | 0.100–1 | Yaw loss strength. Recommended: 0.05-0.2. Higher values can over-constrain and reduce detail. |
| enable_cube_loss | BOOLEAN | false | Pole distortion reduction via cubemap reprojection loss. Use if poles look smeared/warped; ~1.5x slower. |
| cube_loss_weight | FLOAT | 0.100–1 | Cube loss strength. Recommended: 0.05-0.2. Increase slowly if poles still look distorted. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |