Nodes/ComfyUI_KubaNodes/kubakub region sampler
ComfyUI Node

kubakub region sampler

Run a region plan on an image, region by region. inpaint: the region is cut out with context, scaled uniformly to about region_mp on the model grid, inpainted with its own prompt and the crop as reference, colour matched and pasted back. frame_in_frame: the region gets its own scene generated from scratch, placed through its mask, and its border is harmonized. Later regions see earlier ones. Flux 2 Klein and Qwen Image 2.1 are detected automatically. Results are kept in RAM across queues: a region whose crop pixels, masks, prompt, seed, settings and models are unchanged is pasted from the cache, so changing one prompt re-samples only that region (and later regions whose crops overlap it).

By kubakubkub·Created 15 days ago·Updated 3 days ago· 9
kubakub region sampler
  • model
  • clip
  • vae
  • plan
  • image
  • style
  • image
  • changed
  • report
◄steps0►
◄cfg0.0►
◄sampler_nameeuler►
◄schedulersimple►
◄region_mp1.00►
◄max_upscale4.00►
◄scheduleauto►
◄seed_offset0►
◄adapterauto►
◄only►
Categorykubakub/2d/generate

Inputs (16)

NameTypeDefaultDescription
modelMODELThe image model (Flux 2 Klein, Qwen Image 2.1 or a generic model), with any LoRAs already applied.
clipCLIPThe text encoder that matches the model.
vaeVAEThe VAE that matches the model.
planKUBA_PLANFrom kubakub region plan.
imageIMAGEThe canvas, exactly the size of the regions (e.g. the 3840x2160 facade render or photo).
stepsINT00–200Used where the plan says steps = 0. 0 = the model's default (Klein 4, Qwen Image 2.1 25).
cfgFLOAT0.00–30Used where the plan says cfg = 0. 0 = the model's default (1.0).
sampler_nameCOMBOeulerSampler for every region (euler is a safe default).
schedulerCOMBOsimpleGeneric models only; Flux 2 always uses its own schedule (core Flux2Scheduler for the crop size).
region_mpFLOAT1.000.1–4Work megapixels per region crop (region + context), and the size of frame_in_frame scenes. Small regions are scaled up to this, large ones down.
max_upscaleFLOAT4.001–8Small regions are scaled up at most this much.
scheduleCOMBOautoauto: steps / sampler / scheduler as set. qwen21_turbo_5: the 5 trained steps of the Viggle Qwen-Image-2.1 turbo LoRA (load it with LoraLoaderModelOnly); pruna_qwen21_8: the 8 trained steps of the Pruna Qwen-Image-2.1 LoRA (strength 1.0). Partial denoise starts at the matching step, steps is ignored. Sampler as set (euler, or res_2s / deis_2m for more detail).
seed_offsetINT00–4294967295Added to every region seed, for a new variation of all regions.
adapterCOMBOautoModel family; auto detects Flux 2 and Qwen Image 2.1.
onlyoptSTRINGProcess only the regions matching these selectors (plan syntax: space = AND, comma = OR). Empty = all.
styleoptIMAGEA style image for the regions whose plan says reference = style: the model sees it as a second reference next to the region's own crop (scaled to about 1 megapixel). Of a batch the first image is used.

Outputs (3)

NameTypeDescription
imageIMAGEThe image with all processed regions pasted in.
changedMASKWhere pixels were replaced (paste alpha).
reportSTRINGModel, cache use, time, and one line per region (status, crop box and scale).