Nodes/ComfyUI-DiT360/360° KSampler
ComfyUI Node

360° KSampler

The sampler that makes the left edge agree with the right edge

By cedarconnor·Created 10 months ago·Updated 9 months ago· 3
360° KSampler
  • model
  • positive
  • negative
  • latent_image
  • LATENT
seed0
steps20
cfg3.5
sampler_name
scheduler
denoise1.00
circular_padding16
enable_yaw_lossfalse
yaw_loss_weight0.10
enable_cube_lossfalse
cube_loss_weight0.10

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_padding to 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.

CategoryDiT360/sampling

Inputs (15)

NameTypeDefaultDescription
modelMODELConnect your diffusion MODEL (e.g., FLUX UNet + DiT360 LoRA).
seedINT00–18446744073709550000Noise seed. Use a fixed value for reproducible results; use randomize/increment to explore variations.
stepsINT201–10000Diffusion steps. Recommended: ~20. Increase (30-50) for more detail; decrease for speed.
cfgFLOAT3.50–100Classifier-free guidance. Recommended: ~3-5 for FLUX. Too high can cause harsh contrast or blown highlights.
sampler_nameCOMBOSampler algorithm. Recommended: euler. Change only if you know what you prefer.
schedulerCOMBOStep scheduler. Recommended: simple (FLUX default).
positiveCONDITIONINGPositive prompt conditioning.
negativeCONDITIONINGNegative prompt conditioning.
latent_imageLATENTStarting latent. Use 360° Empty Latent for text2img, or a latent from img2img.
denoiseFLOAT1.000–1Denoise strength. Recommended: 1.0 for text2img; <1.0 for img2img to preserve structure.
circular_paddingINT160–128Latent-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_lossBOOLEANfalseYaw-rotation consistency loss during sampling. Use if the panorama changes noticeably when yaw-rotated; ~2x slower.
yaw_loss_weightFLOAT0.100–1Yaw loss strength. Recommended: 0.05-0.2. Higher values can over-constrain and reduce detail.
enable_cube_lossBOOLEANfalsePole distortion reduction via cubemap reprojection loss. Use if poles look smeared/warped; ~1.5x slower.
cube_loss_weightFLOAT0.100–1Cube loss strength. Recommended: 0.05-0.2. Increase slowly if poles still look distorted.

Outputs (1)

NameTypeDescription
LATENTLATENT