Nodes/ComfyUI DP Dynamic Random Styler/DP Advanced Sampler Modified
ComfyUI Node

DP Advanced Sampler Modified

A KSampler that does its own hires fix and hands back a ready image

By DesertPixelAi·Created about a year ago·Updated about a year ago· 2
DP Advanced Sampler Modified
  • model
  • vae
  • positive
  • negative
  • latent_image
  • sampled_latent
  • sampled_image
  • upscaled_latent
  • upscaled_image
  • sampler_info
seed0
batch_modenormal
steps20
cfg8.0
sampler_name
scheduler
denoise1.00
enable_upscalefalse
two_step_upscalefalse
scale_by1.50
upscale_steps10
upscale_cfg7.0
upscale_sampler_name
upscale_scheduler
upscale_denoise0.50

The odd one out in this pack: no prompt files, no face detection, just sampling. DP_Advanced_Sampler_Modified is a re-implementation of ComfyUI's Advanced Sampler that the author bent in three directions - it decodes the result for you, it can run a latent hires-fix in the same node, and it fixes a genuinely annoying batch behavior. If you've built a face-swap workflow from this pack, this is the node that actually renders the image.

How it works

Under the hood it's the same machinery as a stock KSampler - it calls comfy.sample.sample with your model, positive/negative conditioning, latent_image, sampler, scheduler, steps, cfg, denoise, and seed. The first difference you'll notice: vae is a required input, because the node decodes the sampled latent for you. You get an IMAGE out of the box, no separate VAEDecode needed.

That's why it's "modified" rather than a fork with a new name: stock Advanced Sampler gives you a latent and a set of fine-grained controls (add_noise, start_step, last_step...); this one drops most of those, folds in the VAE decode, and adds extras.

Three things actually distinguish it from just using KSampler + VAEDecode:

  • enable_upscale - turns on a latent hires-fix. It bicubic-upscales the latent by scale_by (default 1.5x), then runs a second sampling pass at upscale_steps (10), upscale_cfg (7), and upscale_denoise (0.5). That's the classic latent-upscale second pass for adding detail at higher resolution, just wrapped in one node. This is the setting that matters for the pack's face-swap use case - the initial pass makes the subject, the upscale pass sharpens the costume detail.
  • two_step_upscale - splits that upscale into two passes at the square root of the scale each, bumping the denoise by 0.05 on the second. More passes, gentler steps; marginally better coherence on big scale jumps, at the cost of time.
  • batch_mode - set it to batch_all_random and each item in a batch latent gets its own seed and noise. Default normal mode samples the whole batch from one seed, which is why batch renders come out as copies of the same image. This node actually fixes that, which is more than the stock sampler does.

Outputs and the gotcha

You get five outputs: sampled_latent, sampled_image, upscaled_latent, upscaled_image, and sampler_info (a string logging the seed, batch mode, sampler/scheduler/denoise, and every upscale parameter - genuinely handy for reproducing a run or debugging why output changed).

The trap is that upscaled_latent and upscaled_image are None when enable_upscale is off. Wire them into a Save Image without upscaling enabled and you'll get a null-input error. So: if you're upscaling, read from upscaled_image; if not, ignore those two outputs entirely. This is the #1 way people hit an error here.

Defaults worth second-guessing

The defaults lean old-school: cfg 8 and steps 20. This pack targets SDXL, and the KB's guidance is CFG 5–9 with DPM++ 2M Karras at 20–30 steps - so the defaults are legal but hot. For SDXL I'd drop cfg toward 6–7 and grab dpmpp_2m/karras; the 44 samplers and 9 schedulers available are ComfyUI's stock lists, so all the usual sampler advice applies. And remember this is an SDXL/DDPM-style workflow - don't carry these settings to a flow-matching model like Flux, where CFG 8 and Karras are actively wrong.

Install

Same as the rest of the pack: ComfyUI Manager (search "ComfyUI DP Dynamic Random Styler") or git clone https://github.com/DesertPixelAi/comfyui-dp-them-styler into custom_nodes/, restart. No extra dependencies beyond what ComfyUI already has. Zero impressions on the search side and no community footprint means nobody's really finding this node yet - but for a self-contained hires-fix sampler with a readable parameter dump, it's a reasonable drop-in if you want the batch-random mode.

CategoryDesert Pixel/sampling

Inputs (20)

NameTypeDefaultDescription
modelMODEL
vaeVAE
seedINT00–18446744073709550000
batch_modeCOMBOnormal2 options: normal, batch_all_random
stepsINT201–10000
cfgFLOAT8.00–100
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
positiveCONDITIONING
negativeCONDITIONING
latent_imageLATENT
denoiseFLOAT1.000–1
enable_upscaleBOOLEANfalse
two_step_upscaleBOOLEANfalse
scale_byFLOAT1.500.01–8
upscale_stepsINT101–10000
upscale_cfgFLOAT7.00–100
upscale_sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
upscale_schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
upscale_denoiseFLOAT0.500–1

Outputs (5)

NameTypeDescription
sampled_latentLATENT
sampled_imageIMAGE
upscaled_latentLATENT
upscaled_imageIMAGE
sampler_infoSTRING