Nodes/ComfyUI-Element_TileEdit/Element Tile Encode
ComfyUI Node

Element Tile Encode

One prompt and one latent per tile, then a plain KSampler

By supElement·Created 20 days ago·Updated about 20 hours ago· 15
Element Tile Encode
  • model
  • vae
  • clip
  • tile_images
  • model
  • tile_positives
  • tile_negatives
  • tile_latents
◄tile_prompts—►
◄tile_negatives—►
◄reference_modefalse►
◄grounding_px768►

Instruction editors like Qwen-Image-Edit, FLUX.2 klein and Krea 2 are great until the job is "keep this frame as it is and only add detail" - then the whole-frame re-emit bites you and pixels nobody asked about move. The usual fix is a mask. The other fix is tiles, each with its own prompt and reference, which is the premise of Element TileEdit. Element Tile Encode is the middle of it.

What it is, and when you'd unplug the all-in-one

If you only run the pack's Element Tiled Upscale node you'll never touch this. Encode exists for the split chain - Element Tile Split → Element Tile Encode → your KSampler → Element Tile Merge - where Split hands out tiles plus matching prompts, Encode turns each into a latent and a conditioning pair, and Merge stitches. The reason to split: the one-shot node owns the sampler, so your own sigma curve or a manual redo of one bad tile isn't on the menu.

What makes the pack worth installing is the mechanism. Classic tiled upscaling (Ultimate SD Upscale, TTP) rides img2img, so redraw strength and feature survival both live in denoise - low is plastic, high drifts, so everyone parks it at 0.2–0.5. This pack injects the original pixels as a reference signal the sampler sees every step, which is why denoise can hit 0.7–1.0 with identity intact.

How it works

Encode is a list node: inputs arrive per-tile, outputs come back per-tile. That's what keeps the graph short - wire a list into a KSampler and ComfyUI runs it once per element, broadcasting the scalars. No loop node.

Per tile it does the obvious half and the clever half. Obvious: vae.encode() the crop to a latent and run its prompt and negative through clip. Clever: which reference channel gets attached, picked automatically from what you wired.

  • Grounded - prompts non-empty, tokenizer takes images, model isn't FLUX.2 family. The tile's pixels go into the text encoder's vision slots, so the model sees the tile. That's Qwen-Image-Edit 2509/2511 and Qwen-Image 2.1.
  • Krea 2 in-context - turn reference_mode on and the tile latent rides as reference_latents in the index_timestep_zero layout identity-edit expects.
  • Generic reference latents - everything else; each tile attaches its own latent, with per-step weakening left to a model patch. MOSS-Image uses its own native layout.

The inputs that matter

Six required ports, five of them "wire the matching output from Split": model, vae, clip, tile_images, tile_prompts, tile_negatives. None are optional at runtime - miss clip and it raises; mismatch prompt count against tile count and it raises with both numbers.

The two optional widgets are the ones you think about:

  • reference_mode (default off, labelled Krea 2 identity-edit / conditioning). On for Krea 2 with its identity-edit LoRA; on anything else it warns and falls back to the conditioning path, so a stray true won't break you.
  • grounding_px (default 768). Per the tooltip, the vision-slot size for the per-tile text encode: on Qwen Edit 2509/2511 an area bucket where 0 or ≥384 means the official 384×384 resize; Qwen-Image 2.1 ignores it; Krea 2 caps its vision input's longest side with it. Also your VRAM lever.

Outputs go straight into a KSampler: tile_positives → positive, tile_negatives → negative, tile_latents → latent_image.

Install

Manager: search ComfyUI-Element_TileEdit, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/supElement/ComfyUI-Element_TileEdit

It was renamed - the repo is ComfyUI-Element_TileEdit now and the old URL redirects. Nothing to pip install; no requirements.txt, nothing beyond ComfyUI itself. Downloads are model-side: Qwen-Image-Edit and its CLIP, or Krea 2 plus the krea2_identity_edit LoRA, or Moss plus Moss-Image-Edit. Workflows ship in workflow/.

Common issues

"N prompt(s) for M tile image(s)". You wired one string where Split's prompt list belongs. In count/size mode Split repeats the same global prompt for every tile, which is why the README insists it be true of every tile - an instruction and a look, not "woman at a computer".

Krea 2 acts like there's no reference. With reference_mode on you must run Element Krea2 In-Context Patch before the KSampler; without it ComfyUI core drops the reference_latents key and the reference never reaches the model. With it off you're on the conditioning path, where the patch is just as mandatory.

You wanted the per-step reference curve and got a flat one. Encode outputs no MODEL, so it can't schedule. Put Element Strength Schedule between model and KSampler on the generic path, stacked on the in-context patch for Krea 2. An all-1.0 schedule costs nothing; fractional values buy dual forward passes on those steps.

Out of VRAM. Every tile encodes its own reference latent, and the grounded path re-runs the vision encode per tile. Drop grounding_px, use smaller tiles, stay at or under 2MP per tile.

On SDXL or a plain text-to-image model it still runs, but degenerates into ordinary tiled img2img, and the author says so outright: not better than TTP there.

Two things to remember when it misbehaves. Models are identified by string-matching class names and reflecting on tokenizers - reverse-engineering, per the README - so an update can break detection quietly while the node still runs; read the mode line Encode logs before touching settings. And each node registers inside its own try/except, so an import failure makes one node vanish from the menu instead of crashing ComfyUI: search the console for [Element TileEdit] ... failed to load.


Sources: the pack README, md/Description_en.md and nodes_encode.py, plus modidex background on tiled upscaling.

CategoryElement TileEdit

Inputs (8)

NameTypeDefaultDescription
modelMODEL—
vaeVAE—
clipCLIP—
tile_imagesIMAGE—
tile_promptsSTRING—
tile_negativesSTRING—
reference_modeoptBOOLEANfalse—
grounding_pxoptINT7680–4096Vision-slot size for the per-tile text encode. Qwen Edit 2509/2511: area bucket, 0 or >=384 = official 384x384 resize. Qwen Image 2.1: ignored. Krea 2: caps the vision input's longest side.

Outputs (4)

NameTypeDescription
modelMODEL—
tile_positivesCONDITIONING—
tile_negativesCONDITIONING—
tile_latentsLATENT—