Toggle Theme

ComfyUI Upscaling and Inpainting: Hires Fix, FaceDetailer, and Local Repairs

Easton editorial illustration: large rounded image-editing canvas with a pixel-soft left region and a clean detailed right region, orange translucent inpaint mask over one small facial area, magnifier revealing restored pixels

"The official ComfyUI image-upscaling tutorial documents the Load Upscale Model and Upscale Image (Using Model) workflow and the upscale_models directory."

You generated a 768×1024 character image. The composition and lighting work, but the face in the distance is soft. A direct 4x upscale makes the detail look hard and pasted on; FaceDetailer makes the person look different; an inpaint pass on a small background flaw shifts the color of the entire backdrop.

Pixel upscaling, latent resampling, FaceDetailer, and manual inpainting solve different problems. The sections below cover node connections, parameter meaning, a first task for each path, and fixes for blur after upscaling, edits outside a mask, and identity drift after face repair.


Post-processing quality: where the four paths differ

After generating an image you like, the remaining problem usually falls into one of three buckets: the resolution is too low, the detail is too soft, or one local region needs correction. ComfyUI has four main post-processing paths, and each has a different boundary.

Pixel upscaling uses models such as ESRGAN to increase image dimensions. It normally does not resample the prompt or deliberately change composition, although a super-resolution model can reconstruct or invent texture. Use it when the source image already works and you only need a larger output.

Latent resampling enlarges the latent and samples it again. It allows structural change and fits cases where you want newly generated material or extra detail.

FaceDetailer detects a face region and performs a local repair. It is useful for a small, soft face. Hands and other objects require the matching Detector and Detailer or a manual mask; FaceDetailer is not a universal repair node.

Manual inpainting uses Mask Editor to specify the area that should receive most of the change. It works for a logo edge, a small background defect, or a particular object, but sampling and compositing can still alter the visual result outside the mask.

These paths are not interchangeable. Pixel upscaling does not preserve identity by itself, FaceDetailer is not face swapping, and inpainting does not guarantee that every pixel outside the mask stays identical. First decide whether the problem is size, regenerated detail, a detected region, or a specific local edit.


Pixel upscaling: UpscaleModelLoader + Upscale Image using Model

Pixel upscaling is the simplest post-processing path. If the image is already correct and only needs a larger output, it is usually the least destructive place to start.

Your first upscale task

Assume you generated a 768×1024 image and want a larger version.

First, download an upscale model that matches the image type from Real-ESRGAN or another trusted model source, such as RealESRGAN_x4plus.pth or RealESRGAN_x4plus_anime_6B.pth.

Second, place the model file in ComfyUI/models/upscale_models/.

Third, refresh the ComfyUI interface or restart it so that the model list is scanned again. If the model is still missing, check the path, extension, and extra_model_paths.yaml.

Fourth, connect the nodes. UpscaleModelLoader selects the model. Upscale Image (Using Model) receives upscale_model and image. Connect the generated image to its image input.

Fifth, run the node and inspect the output dimensions. A 4x model normally produces four times the width and height, but treat the node output as the source of truth for final size and resource use.

Choosing an upscale model

ModelBest starting pointCharacteristics
4x-ESRGANGeneral upscalingOfficial tutorial example and a useful baseline
RealESRGAN_x4plusPhotos and realistic scenesGeneral restoration model worth testing on natural texture
RealESRGAN_x4plus_anime_6BAnime and illustrationAnime-oriented model worth testing on lines and flat color
realesr-general-x4v3Lightweight general useA lighter model direction for batch comparisons

There is no universal “best upscale model.” Results depend on the image type, base model style, compression artifacts, and scale. Start an illustration with the anime model and a photo with a general model, then compare edges, skin, hair, and fine texture.

Model directory reminder

Upscale models normally go in upscale_models, not upscale_model. UpscaleModelLoader can also read extra directories configured through extra_model_paths.yaml. If the list does not update, check the path and file first, then refresh or restart.


Latent upscale and a second sample: LatentUpscale + KSampler

Pixel upscaling does not reinterpret the prompt. If you want new material or detail after enlarging the image, use latent upscaling followed by another sampling pass. The denoise value determines how much of the source survives.

LatentUpscale parameters

ParameterPurposeNotes
upscale_methodUpscaling algorithmCommon options include nearest-exact, bilinear, and bislerp
width / heightTarget dimensionsSet one side to 0 to preserve aspect ratio from the other side
cropCropping behaviorCommon options are disabled and center

LatentUpscale outputs a larger latent, which then goes into KSampler. A denoise value near 1.0 regenerates more of the image: detail may increase, but composition, face, and clothing can drift. A value near 0.0 retains more of the source and adds less new detail.

There is no denoise recipe that works for every model. Start low when you only need a little detail. Keep the seed, sampler, steps, CFG, checkpoint, and LoRA weights fixed, and change one variable at a time. When a higher value starts changing identity or growing arbitrary clothing texture, return to the previous stable value.

How it differs from pixel upscaling

PathStructural change?More detail?Best fit
Pixel upscalingNormally does not alter composition intentionallyReconstructs pixel detailThe source is correct and only needs more resolution
Latent resamplingYes, depending on denoiseRegenerates detailSome change is acceptable and material or local structure should be redrawn

Latent resampling is not a simple resize. If the workflow already uses ControlNet, IPAdapter, or regional prompting, a second pass can weaken those upstream constraints. Save the original output and workflow before testing a separate resampling branch.


FaceDetailer repair: automatic face refinement in Impact Pack

A soft face in the distance is a common failure. FaceDetailer combines face detection with a Detailer path in Impact Pack: it detects a local region and then applies detail or inpainting to the crop. It can improve a small face, but it is not an identity-consistency or face-swap tool.

Installing Impact Pack

Impact Pack is a third-party custom node pack, and its maintainer recommends installing it through ComfyUI Manager. Open the custom-node installation area, search for ComfyUI-Impact-Pack, install it, and restart ComfyUI.

Impact Pack changes frequently, including node structure and compatibility requirements. Its current README also notes that some Ultralytics Detector Provider nodes require the separate Impact Subpack. If an old workflow has red nodes, a missing detector, or different parameters, check the current Impact Pack README, Subpack instructions, and Manager status instead of copying an old screenshot.

Your first face-repair task

Assume the generated image contains a soft face in the distance.

First, add FaceDetailer from the Impact Pack menu.

Second, connect the workflow’s image, model, clip, vae, detector, and any other required inputs. Inputs can change between versions, so use the current node and README as the authority.

Third, focus on the detected area, guide_size, max_size, noise_mask, inpaint_model, and cycle. guide_size controls the reference size used while detailing a small region. max_size limits the region’s long edge and VRAM use.

Fourth, begin with conservative denoise. A value around 0.3–0.5 can be a practical starting range for face repair, not an official fixed setting. The smaller the source face and the larger the detection box, the more cautious you should be.

Fifth, compare the source and repaired images. Confirm that the face is clearer without unnecessarily changing identity, expression, hair, or background.

FaceDetailer parameter table

ParameterPurposeAdjustment guidance
guide_sizeReference size for the region processed by DetailerStart with a moderate size; larger values increase redraw and VRAM pressure
max_sizeMaximum size for the processed regionUse it to constrain VRAM and oversized detection boxes
noise_maskWhether to apply a noise mask to the detected regionTreat it as a switch and confirm behavior in the installed version
inpaint_modelWhether to use the inpaint-model pathConfigure it when the workflow uses a dedicated inpaint checkpoint
cycleNumber of Detailer passesStart with 1; repeated passes can drift farther from the source face

The detector determines which region is processed. If FaceDetailer makes a face worse, verify that the detector selected the correct face, then reduce the region, denoise, or guide size. A broken hand needs a hand detector and Detailer or manual inpainting; FaceDetailer should not be expected to repair it automatically.

FaceDetailer boundaries

FaceDetailer can improve facial detail, but it does not promise to preserve the original identity. Use FaceID, InstantID, ReActor, or LoRA when identity consistency is the real requirement. Only use owned or authorized material for a real person’s face.


Manual inpainting: change one region without rebuilding everything

Manual inpainting is more controllable when the target is a logo edge, a small background flaw, or one hand. The mask tells the workflow where to focus, but the final affected area still depends on encoding, conditioning, denoise, and compositing.

Mask Editor steps

Assume a product image has a small background defect.

First, load the source in Load Image, right-click the node, and choose Open in MaskEditor.

Second, paint over only the region that needs correction.

Third, use the eraser to fix excess coverage and leave a sensible transition margin around the edge.

Fourth, click Save so the mask returns to the image node and can feed the inpainting path.

Two common inpainting connections

Native workflows commonly use one of two conditioning paths. Do not mechanically chain both into a single path.

The first uses VAE Encode (for Inpainting). It receives pixels, vae, mask, and grow_mask_by, and outputs a latent that includes a noise mask. Connect that latent to KSampler, then decode the result with VAE Decode.

The second uses InpaintModelConditioning. It receives positive and negative conditioning, vae, pixels, and mask, and outputs processed positive conditioning, negative conditioning, and a latent for KSampler. Use this path when the workflow needs dedicated inpaint conditioning.

KSampler itself receives sampling inputs such as model, positive conditioning, negative conditioning, and latent. The VAE belongs in the encoding and decoding nodes before and after it; it is not connected directly to KSampler.

What grow_mask_by does

grow_mask_by expands the mask outward to provide a transition area in latent space. A mask that is too tight can create a hard edge, while one that is too large can redraw content that was already correct. Start with a small expansion, inspect the seam and background, and increase it gradually.

Fixing visible seams

If the edge has a seam, mismatched brightness, or a pasted-on look, modestly increase grow_mask_by, lower denoise, and feather the mask. Third-party inpaint nodes can add preprocessing such as Expand Mask and Blur Masked, but confirm node names and behavior against the installed version.


Advanced options: Ultimate SD Upscale and comfyui-inpaint-nodes

Pixel and latent upscaling cover the basic paths. A very large full-image pass can exhaust VRAM, however, and difficult seams may need more precise mask preprocessing. The following custom nodes are advanced options, not required dependencies for a first workflow.

Ultimate SD Upscale: tiled enhancement

Upscaling a 1024×1536 image to 4096×6144 can make a full-image second pass expensive. Ultimate SD Upscale divides the image into tiles, runs image-to-image diffusion on each tile, and combines the result.

Tiling keeps each pass closer to the diffusion model’s training size and reduces the hardware pressure of processing the full image at once. The tradeoff is slower execution and the possibility of seams, repeating textures, or inconsistent styling between tiles.

Install it by searching for ComfyUI_UltimateSDUpscale in ComfyUI Manager. Installation entry points, menus, and parameters can change, so verify them against the current README and node interface.

comfyui-inpaint-nodes: mask preprocessing

comfyui-inpaint-nodes provides Fooocus inpaint support, LaMa, MAT, and tools for expanding, shrinking, blurring, and filling masks. Fooocus inpaint models normally go in ComfyUI/models/inpaint, but confirm model compatibility and the conditioning path in the repository’s current README.

NeedPreprocessing to test
Visible seam around the editExpand Mask plus Blur Masked
More precise mask extentShrink Mask or Expand Mask
A better initial fill inside the maskFill Masked
Object removal or outpaintingLaMa, MAT, or the matching outpaint workflow

Denoise is not a universal fix. A value near 1.0 redraws the masked region more completely, while a lower value retains more source content, but behavior also depends on the model and conditioning path. If content outside the mask shifts, verify connections and compositing before shrinking the mask, lowering denoise, or changing the transition width.


Decision table: scenario × post-processing path

ScenarioRecommended pathWhyAlternative
The source is correct and only needs more resolutionPixel upscalingNormally preserves composition while enhancing pixelsLatent resampling when detail must be regenerated
Material or detail should be regeneratedLatent resamplingDenoise controls retention versus redrawUltimate SD Upscale for a very large image
A distant face is softFaceDetailerDetects a face and details it locallyManual inpainting when detection is wrong
A hand, object, or logo has a local errorManual inpainting or the matching DetailerA mask or detector constrains the work areaReturn to generation when the structure is wrong
The target resolution exceeds available VRAMUltimate SD UpscaleTiled img2img lowers per-tile pressureReduce target size and use pixel upscaling
The edit has a visible edge seamExpand and feather the maskGives the local redraw a transition regionReduce the edit strength and denoise

Strengths and tradeoffs

PathStrengthsWeaknessesVRAM demand
Pixel upscalingFast, normally preserves composition, many model choicesCannot fix structural errors and may create artificial textureLow to medium
Latent resamplingCan redraw material and detail, highly adjustableDenoise needs tuning and the image can driftMedium to high
FaceDetailerDetects faces automatically without a hand-drawn face maskDoes not preserve identity and can over-repairMedium to high
Manual inpaintingTargets a defined area with clear controlRequires a mask, edge tuning, and correct conditioningMedium
Ultimate SD UpscaleProcesses very large images in tilesSlower and can create tile seamsDepends on tile and model

Do not enable every post-processing node at once. Use the least destructive path that solves the current problem, save the intermediate result, and then decide whether another sampling or local repair pass is justified.


Post-processing order affects the result. A character image can start with conservative upscaling, then repair detected regions, then make a manual local edit. This is a useful baseline, not a fixed recipe for every image.

Why this order works

Save the source image and workflow first. If the only issue is size, use pixel upscaling because it normally does not resample the prompt.

Next, inspect the face, hands, and other small regions. Use FaceDetailer for a face and the matching Detector and Detailer or manual mask for a hand or object. A larger source makes it easier to judge whether repair is excessive.

Use manual inpainting last for a logo, edge, background flaw, or other exact region so that an earlier full-image operation does not undo the local repair.

Risks of a second pass

When the workflow already uses ControlNet, IPAdapter, or regional prompting, latent resampling and the local sampling inside a Detailer can weaken upstream conditions. Pose, line art, hair color, clothing, and reference identity can all drift.

If a second pass is necessary, keep the original conditions, fix the seed and other parameters, and start at low denoise. When the upstream result matters more than new detail, test pixel upscaling first and decide whether resampling is worth the change.


Common failures: blur, face drift, seams, and mask spill

SymptomCommon causeWhat to do
The upscale is soft or unnaturally hardThe model does not match the image type, or repeated upscaling is excessiveCompare general, photo, and anime-oriented models and reduce repeated processing
The face no longer looks like the personSecond-pass denoise is too high or the Detailer region is too largeLower denoise and shrink the detected region; use a dedicated identity method when identity is the issue
Arbitrary texture appearsTiled upscale or high denoise is redrawing too aggressivelyLower denoise, remove new prompt information, and test on a smaller image first
The mask edge has a seamThe mask is too tight, lacks transition, or shifts local brightnessAdjust grow_mask_by, feather the edge, and reduce edit strength
Content outside the mask changesMask, noise mask, conditioning, or compositing is incorrectVerify connections, shrink the mask, and lower denoise
FaceDetailer cannot find the faceThe face is too small, the angle is unusual, or the detector does not matchApply a conservative upscale or change detector; do not force repair with high denoise
The upscale model is missingThe path or extension is wrong, or the list was not refreshedPut it in upscale_models or configure an extra path, then refresh or restart
Ultimate SD Upscale is a red nodeThe custom node is missing or its version and dependencies do not matchCheck installation and updates in Manager; troubleshoot complex conflicts separately
The workflow runs out of VRAMResolution, tile, batch, or Detailer region is too largeReduce size and batch, cap max_size, shrink the tile, or use pixel upscaling

Next step: keep repairing or return to generation?

Continue post-processing when composition, identity, pose, and product shape are already correct and only resolution, a small face, a hand, or a local defect remains. The ideal change fits inside a small detector box or mask.

Return to generation when identity, pose, clothing, subject count, or product structure is wrong. Adding more denoise and inpainting usually increases uncertainty rather than fixing the underlying constraint. Correct the prompt, ControlNet, reference image, or model choice instead.

A character or product that must remain stable across many outputs also needs more than repeated inpainting. Post-processing finishes one image that is already mostly correct; it does not replace identity assets, structural control, or training.


Conclusion

ComfyUI post-processing has four main paths: pixel upscaling, latent resampling, FaceDetailer face repair, and manual inpainting. Start with pixel upscaling when the source content is right. Use a low-denoise latent second pass only when detail should be regenerated. Use FaceDetailer for a soft distant face without treating it as identity preservation, and use a manual mask plus an inpaint conditioning path for a specific local error.

A practical character-image sequence is conservative upscaling, detected-region repair, and a final manual edit. If a full-image second pass exceeds available VRAM, Ultimate SD Upscale can process tiles, but every seam and local style transition still needs review. Comparing each intermediate image with the source makes it much easier to locate face drift, artificial texture, and changes outside the mask.

Choose and run a ComfyUI post-processing path

Classify the problem as size, regenerated detail, a small detected defect, or a specific local edit, then use the least destructive path first.

  1. 1

    Step 1: Preserve the original output

    Save the source image, workflow, seed, checkpoint, sampler, steps, and CFG so that each later test changes only one variable.
  2. 2

    Step 2: Decide whether the image only needs to be larger

    If composition, identity, and texture are already correct, start with UpscaleModelLoader and Upscale Image (Using Model).
  3. 3

    Step 3: Decide whether to resample

    Use LatentUpscale plus KSampler only when you want regenerated material or detail, and begin with a low denoise value.
  4. 4

    Step 4: Repair a small face or detected region

    Use FaceDetailer or another Detector-plus-Detailer path, limiting guide_size, max_size, and denoise so it does not redraw the background.
  5. 5

    Step 5: Draw a mask for a specific edit

    Cover only the target area in Mask Editor, leave a small transition margin, and connect either VAE Encode (for Inpainting) or an InpaintModelConditioning path.
  6. 6

    Step 6: Check seams and spill outside the mask

    If you see hard edges, color shifts, or a pasted-on patch, adjust grow_mask_by, feathering, and denoise, then verify the mask and noise mask.
  7. 7

    Step 7: Reduce VRAM pressure on very large images

    Lower the target size or use Ultimate SD Upscale for tiled processing, then inspect every tile boundary and texture transition.
  8. 8

    Step 8: Keep the smallest successful change

    Compare the source, pixel-upscaled, resampled, and locally repaired versions, and retain the result that meets the goal with the least structural drift.

FAQ

How do you build a Hires Fix workflow in ComfyUI?
ComfyUI usually breaks Hires Fix into low-resolution generation, latent or image upscaling, and a second KSampler pass with low-to-medium denoise. The important control is resampling strength, not a node with a fixed Hires Fix name.
What is the difference between Latent Upscale and Upscale Image (Using Model)?
Latent Upscale enlarges the latent and requires another sampling pass, so it can add detail or alter structure. Upscale Image (Using Model) processes pixels and is better when the content is already correct and only needs a larger output.
Where do ComfyUI upscale models go?
The official tutorial and node documentation use ComfyUI/models/upscale_models. UpscaleModelLoader can also read directories configured in extra_model_paths.yaml. Refresh the interface or restart after adding a model.
Is FaceDetailer a face-swap tool?
No. FaceDetailer detects a face region and applies detail or inpainting to improve a small face. Identity consistency needs a dedicated approach such as FaceID, InstantID, ReActor, or LoRA, using only authorized material.
Why does inpainting change pixels outside the mask?
Common causes include excessive denoise, an incorrect mask or noise-mask connection, an oversized transition region, and sampling or compositing that affects the full latent. Shrink the mask, lower denoise, and verify the conditioning path.
What should you change when FaceDetailer makes a face look worse?
First confirm that the detector selected the correct region. Then reduce the detection box or guide_size and lower denoise. If the source face has too few pixels, apply a conservative full-image upscale before trying a stronger repair.
When should you use Ultimate SD Upscale?
Use it when the target image is too large for a full second pass or when pixel upscaling lacks detail. It adds more controls and can introduce tile seams or inconsistent local styling.

16 min read · Published on: Jul 22, 2026 · Modified on: Jul 21, 2026

Comments

Sign in with GitHub to leave a comment

Easton BlogEaston Blog