Nodes/ComfyUI_MiraSubPack/Tiled Image KSampler with Tagger
ComfyUI Node

Tiled Image KSampler with Tagger

Sample every tile with its own prompt — the KSampler that runs the tiled loop

By mirabarukaso·Created 9 months ago·Updated 2 months ago· 0
Tiled Image KSampler with Tagger
  • model
  • clip
  • tiled_samples
  • clip_negative
  • ref_latents
  • tiled_latents
common_positive
common_negativebad quality, worst quality, worst detail, sketch
tagger_text
seed0
steps16
cfg7.0
sampler_nameeuler_ancestral
schedulerbeta
denoise0.35
modeNormal
noise_boost0.00
noise_injection_methodadaptive

This is the engine of the pack's tiled upscaler: a KSampler that runs on your batch of tiles and, here's the twist, can give each tile its own prompt. One line of tagger_text per tile, appended to a common positive prompt. So a sky tile gets sky tags and a face tile gets face tags, all in one node, instead of you hand-splitting the batch and sampling regions separately.

The "with Tagger" workflow makes sense in the tiled-upscale loop this pack is built around: ImageCropTilesVAEEncode → this node → VAEDecodeOverlappedImageMerge. You caption the tiles (the pack's ImageTilesToLLM node does exactly that for you), paste the per-tile results into tagger_text, and this node's tiled_latents output feeds the decode. It's tiled img2img at low denoise (default 0.35), which is the hi-res-fix pattern the upscaling doc describes - but with per-tile prompt control on top.

The inputs that matter

  • model / clip - your checkpoint's model and CLIP, same as any KSampler.
  • tiled_samples - the tiled latents from VAEEncode_MiraSubPack.
  • common_positive - the base prompt every tile shares.
  • tagger_text - one line per tile; each line gets appended to common_positive for that tile's sampling. Leave blank for a plain uniform pass.
  • common_negative - default bad quality, worst quality, worst detail, sketch.
  • seed / steps / cfg / sampler_name / scheduler / denoise - the usual sampler knobs. denoise 0.35 is the sensible tiled-img2img starting point; raise toward 1.0 only if you want wholesale regeneration.
  • mode - Normal (ignore ref latents; SDXL/Z-Image) or Reference (use ref_latents; Flux.2-style). Default is Normal.
  • noise_boost / noise_injection_method - only do anything in Reference mode. They perturb the reference latents so the model generates new detail instead of reproducing a blurry original. uniform = plain Gaussian, high_frequency = texture-scale noise, adaptive = more noise into flat regions. 0.3–0.6 is the recommended band for upscaling.
  • clip_negative (optional) - a separate CLIP for the negative if your setup needs one.
  • ref_latents (optional) - reference latents for Reference mode; count should match the tile count, otherwise the first is reused.

One output: tiled_latents (LATENT), same order as input, ready for VAEDecode_MiraSubPack.

How it works, briefly

It parses tagger_text into per-tile tag strings (escaping parens so you can use (word:1.2) weights), tokenizes common_positive + tags for each tile, samples each tile's latent independently with a shared seed, and in Reference mode attaches ref_latents to the conditioning (with optional noise injection per the method chosen) before sampling. Tiles are sampled sequentially, so expect a long run when the tile count is high.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/mirabarukaso/ComfyUI_MiraSubPack

or search "MiraSubPack" in ComfyUI Manager and restart. No extra deps - it uses ComfyUI's own samplers.

Notes

  • Line count is king. If tagger_text has fewer lines than tiles, the extras just sample with the common prompt; more lines are ignored. Make sure ImageTilesToLLM's output has one line per tile.
  • It's sequential, so a 20-tile pass is 20 samplers' worth of time. That's the price of per-tile prompts; a plain batch KSampler would be faster but dumber.
  • If tiles come out inconsistent in color, that's not this node's job to fix - run TiledImageColorCorrection before the merge. And if you're on a model without reference-latent support, keep mode on Normal; the node politely ignores ref_latents and warns you.
CategoryMira/SubPack/Image Tiled Upscaler

Inputs (17)

NameTypeDefaultDescription
modelMODEL
clipCLIP
tiled_samplesLATENTTiled latents input from VAE.
common_positiveSTRINGCommon positive prompt for all tiles.
common_negativeSTRINGbad quality, worst quality, worst detail, sketchCommon negative prompt for all tiles.
tagger_textSTRINGTagger output text mapping for tiles, one line per tile.
seedINT00–18446744073709550000
stepsINT161–100
cfgFLOAT7.00–32
sampler_nameCOMBOeuler_ancestral44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBObeta9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
denoiseFLOAT0.350–1
modeCOMBONormalNormal: ignore ref_latents and noise boost. (SDXL/Z Image) Reference: use ref_latents with optional noise boost. (Flux.2)
noise_boostFLOAT0.000–1Extra noise injected into ref_latents before conditioning to encourage detail generation. Perturbs the reference that guides generation, effective even at denoise=1.0. 0.0 = no boost (original behavior), 0.1~0.3 = subtle detail enhancement, 0.3~0.6 = moderate (recommended for upscale with ref_latents), 0.6~1.0 = aggressive (more creative, may deviate from original). Only effective when ref_latents is connected.
noise_injection_methodCOMBOadaptiveNoise injection method: uniform: Standard Gaussian noise, uniform across all regions. high_frequency: Emphasizes high-frequency detail noise, better for textures. adaptive: Adds more noise to flat/blurry regions, less to detailed areas.
clip_negativeoptCLIP
ref_latentsoptLATENT

Outputs (1)

NameTypeDescription
tiled_latentsLATENT