Tiled Image KSampler with Tagger
Sample every tile with its own prompt — the KSampler that runs the tiled loop
- model
- clip
- tiled_samples
- clip_negative
- ref_latents
- tiled_latents
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: ImageCropTiles → VAEEncode → this node → VAEDecode → OverlappedImageMerge. 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_positivefor 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) orReference(useref_latents; Flux.2-style). Default isNormal. - noise_boost / noise_injection_method - only do anything in
Referencemode. 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_texthas fewer lines than tiles, the extras just sample with the common prompt; more lines are ignored. Make sureImageTilesToLLM'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
TiledImageColorCorrectionbefore the merge. And if you're on a model without reference-latent support, keepmodeon Normal; the node politely ignoresref_latentsand warns you.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| clip | CLIP | — | |
| tiled_samples | LATENT | Tiled latents input from VAE. | |
| common_positive | STRING | Common positive prompt for all tiles. | |
| common_negative | STRING | bad quality, worst quality, worst detail, sketch | Common negative prompt for all tiles. |
| tagger_text | STRING | Tagger output text mapping for tiles, one line per tile. | |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 161–100 | — |
| cfg | FLOAT | 7.00–32 | — |
| sampler_name | COMBO | euler_ancestral | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 |
| scheduler | COMBO | beta | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 |
| denoise | FLOAT | 0.350–1 | — |
| mode | COMBO | Normal | Normal: ignore ref_latents and noise boost. (SDXL/Z Image) Reference: use ref_latents with optional noise boost. (Flux.2) |
| noise_boost | FLOAT | 0.000–1 | Extra 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_method | COMBO | adaptive | Noise 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_negativeopt | CLIP | — | |
| ref_latentsopt | LATENT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| tiled_latents | LATENT | — |