Saltar al contenido

How it works · Working knowledge

Z-Image upscale and refine: mechanisms and practical controls

Produce one Upscaled and refined image, targeting approximately 4 megapixels with the default size controls.

Use this recipe for model upscaling followed by diffusion refinement, rather than an upscale-only or pixel-preserving result.

Input: imageInput: textOutput: imageComfyUI

Before you start

  • Source image: Upload one image. The saved graph names fighter_jet.png, but the interface requires your upload; only RGB enters the processing chain.
  • Positive prompt: Describe the source subject, composition and desired details. The retained default is masterpiece, 8k.

Start with one image and the source defaults

Produce Upscaled and refined image (output:9), the single named image result from the complete chain. Begin with your upload and an image-specific positive prompt. The initial settings are working size 1 MP, final scaling 0.5, denoise 0.33, five steps and CFG 1; leave the negative prompt empty. Keep sampler dpmpp_2m_sde, scheduler beta and sampling shift 3.

These size settings target approximately 4 MP, not necessarily twice the original upload's dimensions. The prompt phrase 8k does not set resolution. There is no separate upscale-only output or supported refinement bypass. This guide classifies the task as upscaling; resolution increase alone does not establish restoration, identity preservation or unchanged pixels.

  1. Upload the image you want to enlarge and refine.

    Look for: The loader's RGB image feeds the chain; its mask output is unused.

  2. Replace or expand masterpiece, 8k with the source subject, composition and desired details, then run with the initial settings above.

    Look for: Positive conditioning guides refinement; the complete chain delivers Upscaled and refined image.

    Outputs: output:9

Exact prerequisites and configuration limits

All five retained preparation components are required:

  • z_image_turbo_bf16.safetensors in diffusion_models, selected by UNETLoader 99.
  • qwen_3_4b.safetensors in text_encoders, selected by CLIPLoader 101.
  • ae.safetensors in vae, selected by VAELoader 108.
  • RealESRGAN_x4plus.safetensors in upscale_models, selected by UpscaleModelLoader 106.
  • tea-time-labs/sweet-tea-nodes for the retained node setup, including SweetTeaPreviewImage.

The diffusion model and text encoder have unresolved Resource identities; that does not make them optional or establish that their files are missing. The three linked prerequisite Resources identify the VAE, upscaler and node pack, not executable fallback recipes.

The saved loader settings are 99.weight_dtype=default, 101.type=lumina2 and 101.device=default. Retain them for the baseline. Model filenames are runtime choices, but compatibility of substitutes is not established. The model components list provider version main, without retained checksums or byte sizes; the node pack has no retained version or commit. These facts do not pin an exact installed environment.

No backend/platform compatibility list, GPU or RAM recommendation, or comparable timing is retained. The preparation workload of 1024×1024 is a reference configuration, not a fixed upload or output size. Individual core-node metadata records differing versions; it does not establish a single required ComfyUI installation version.

How the image reaches the only output

The image path is 77:0 → 107.image → 105.image → 104.image → 103.pixels → 97.latent_image → 96.samples → 9.images.

  1. ImageScaleToTotalPixels 107 sets the working pixel budget, using Lanczos and resolution_steps=1. This can shrink a large upload.
  2. ImageUpscaleWithModel 105 applies the selected 4× RealESRGAN model from 106:0.
  3. ImageScaleBy 104 applies the final scaling multiplier with Lanczos. Despite its UI name, this happens before VAE encoding and diffusion refinement, not after them.
  4. VAEEncode 103 encodes that resized image. KSampler 97 refines the resulting latent, and VAEDecode 96 decodes it. VAELoader 108:0 supplies both VAE stages.
  5. SweetTeaPreviewImage 9 receives 96:0 and exposes Upscaled and refined image through output:9. No intermediate image is separately exposed.

The model branch is 99:0 → 98.model → 97.model: UNETLoader supplies ModelSamplingAuraFlow, retained at shift 3. CLIPLoader 101:0 supplies CLIPTextEncode nodes 100 and 102, whose outputs feed 97.positive and 97.negative. The graph connections establish these routes; they are not editable scalar controls.

Approximate output MP = working MP × (4 × final scaling)². At final scaling 0.5, width and height are approximately twice the working dimensions, giving four times the working pixel count. Aspect ratio follows the upload, subject to image and latent rounding. This is not a fixed enlargement relative to the original.

All resizing, model upscaling and diffusion precede the only output. There is no original-layer compositing or alpha-restoration branch, and the loader's mask output is unused. Lower denoise therefore does not establish exact original-pixel preservation. Node 96 is ordinary VAEDecode, not VAEDecodeTiled.

Choose size and refinement independently

Size controls

Working size (107.megapixels) defaults to 1, range 0.01–16 in 0.01 increments. Final scaling (104.scale_by) defaults to 0.5, range 0.01–8 in 0.01 increments. Both affect the dimensions presented to diffusion, but at different points in the chain. Lowering final scaling does not reduce the earlier RealESRGAN input or its intermediate output. Lowering working size changes that earlier workload too. Neither control has a retained numerical memory or runtime prediction.

As a calculated example, 1 MP with final scaling 0.25 targets approximately 1 MP instead of the default 4 MP. These are estimates from the size formula, not executed examples. Schema maxima are allowed input bounds, not evidence that the largest combination will run on a particular machine.

Refinement controls

Refinement strength (97.denoise) defaults to 0.33, range 0–1 in 0.01 increments. Lower values maintain more source structure; higher values permit more reinterpretation, not guaranteed recovery of true detail. A lower-denoise trial below is an experiment, not a measured optimum or bypass.

Steps (97.steps) default to 5, range 1–10000. More steps add computation and change refinement; improvement is not guaranteed. CFG (97.cfg) defaults to 1, range 0–100 in 0.1 increments. Excessive guidance can hurt quality. Negative prompt (102.text) is empty and has no effect at CFG 1; exclusions become useful when experimenting above 1. A connected negative encoder alone does not establish an effect under the default configuration.

Sampler (97.sampler_name) defaults to dpmpp_2m_sde; scheduler (97.scheduler) defaults to beta. They select the denoising algorithm and noise-removal progression. Alternative choices come from the runtime; no retained list or ranking supports recommending another pairing. Advanced sampling shift (98.shift) defaults to 3, range 0–100 in 0.01 increments. It is a separate model noise-schedule adjustment, not the sampler scheduler; retain 3 initially.

Seed and native types

The UI documents seed -1 as randomize, but the native 97.seed schema accepts nonnegative integers, up to the retained bound 18446744073709552000, and the saved graph contains 824287194145573. A saved randomize widget is marked non-runtime. Treat -1 as a UI convention, not a native set_input value; the translation is not supplied. Use a fixed nonnegative seed for comparisons with the same noise initialization, without assuming pixel-identical results across environments.

The port contract labels CFG as text, while the bound interface and native KSampler schema identify it as a float. Use the native numeric input, not the port's prompt classification.

Restore source refinement strength
Returns denoise to 0.33; details can still change.
Try lower refinement strength
Sets denoise to 0.2 as a comparison trial below 0.33, favoring more source structure without guaranteeing preservation.
Use the saved fixed seed for comparisons
Uses the saved nonnegative noise seed rather than a native value of -1. Keep any UI randomization from changing the seed between comparisons.
Try final scaling 0.25
With working size 1 MP, targets approximately 1 MP before refinement instead of approximately 4 MP. The earlier RealESRGAN stage remains unchanged.

What needs changing after the first result?

  • Output dimensions: Adjust working megapixels or final scaling, not resolution words in the prompt.Continue
  • Source details drift: Compare lower denoise with a fixed seed; this does not establish exact preservation.Continue
  • Exact pixels, alpha or upscale-only delivery: The selected recipe does not expose the required preservation path or intermediate output.Continue

Match the remedy to the actual stage or limitation

Use the source configuration as a baseline and change one setting at a time. Compare delivered dimensions and the content that matters to your use case. No retained executed examples or performance profiles establish an optimal setting. A prerequisite component is not an executable fallback, and no alternative recipe revision is supplied here.

Labels, faces or fine details change

Diffusion refinement can reinterpret content, and the graph has no original-layer compositing path.

Check: The only output follows resizing, model upscaling, KSampler and VAE decoding.

Compare lower denoise against 0.33 with an unchanged nonnegative seed and a source-specific prompt. If exact pixels or guaranteed identity are required, do not treat this recipe as a preservation solution.

Negative prompt edits appear ineffective

Negative conditioning has no effect at the default CFG of 1.

Check: The negative text encoder is connected, but effectiveness depends on CFG.

Leave the negative prompt empty for the baseline. If exclusions are needed, experiment with CFG above 1 while watching for guidance-related quality loss; no optimal value is established.

The result is smaller than expected

Working size normalizes pixel count before the 4× model upscaler, then final scaling changes those dimensions before refinement.

Check: The model's 4× factor is not a guaranteed 4× enlargement of the original upload.

Estimate output MP as working MP × (4 × final scaling)², adjust the size controls and inspect delivered dimensions. Do not use prompt terms such as 8k to set size.

Transparency is missing

Only LoadImage's RGB image enters the processing chain; no alpha-restoration path is retained.

Check: The loader mask output is unused.

Choose a workflow with an established alpha-handling path if transparent delivery is required; no control here restores uploaded alpha.

An upscale-only result is required

The sole exposed output follows diffusion refinement and decoding.

Check: The retained interface provides no bypass or separate output from ImageUpscaleWithModel or ImageScaleBy.

Use a different workflow with an explicit upscale-only output. Do not assume setting denoise to zero creates a supported bypass or removes the VAE round trip.

A required model or node cannot load

The retained loaders require runtime-visible model files, and the output uses a Sweet Tea custom node.

Check: All five preparation components are mandatory. Unresolved Resource identities for two models do not determine whether those files are installed.

Check the exact filenames and directories in the prerequisite section and availability of tea-time-labs/sweet-tea-nodes. Retain the saved loader configuration; compatibility of arbitrary substitutes is not established.

An out-of-memory failure occurs

Capacity requirements are unmeasured, and ordinary VAEDecode 96 has no retained tile_size input.

Check: Final scaling occurs after RealESRGAN, so reducing it leaves that earlier stage's dimensions unchanged.

Identify the failing stage. Reducing working megapixels changes the earlier image workload; reducing final scaling changes the subsequent encoding and refinement dimensions. Neither has a quantified capacity guarantee or addresses model-loading requirements by itself. Do not apply a tiled-decode input to node 96; tiled decoding would require a graph change outside the supplied controls.

Where this approach stops

  • Separate upscale-only output or refinement bypass
  • Uploaded transparency preservation
  • Pixel-exact preservation
  • Guaranteed visual identity or restoration of true detail
  • Fixed enlargement relative to the original upload
  • Quantified memory or runtime recommendations

Sources