Nodes/Shima/Shima Sampler
ComfyUI Node

Shima Sampler

A KSampler that eats bundles and does HiRes Fix

By KDB-USJP·Created 6 months ago·Updated 6 months ago· 2
Shima Sampler
  • positive
  • negative
  • latent
  • model
  • shima.commonparams
  • vae
  • shima.samplercommons
  • modelcitizen.bndl
  • latentmaker.bndl
  • masterprompt.bndl
  • panelinputs.bndl
  • latent
  • image
  • s33d
  • shimasampler.bndl
s33d0
randomizefalse
steps20
cfg8.0
sampler_name
scheduler
denoise1.00
add_noisetrue
start_at_step0
end_at_step10000
return_with_leftover_noisefalse
preview_method
vae_decodetrue
upscale_enabledfalse
upscale_methodnearest-exact
upscale_factor1.50
upscale_denoise0.50
upscale_steps20
upscale_cfg8.0
use_commonparamstrue
allow_external_linkingfalse
show_used_valuesfalse
use_samplercommonsfalse
show_previewtrue

The Shima Sampler is the pack's workhorse: a full drop-in replacement for the core KSampler with one very Shima twist - it can eat the pack's BNDL bundles directly. Wire in a modelcitizen.bndl, a masterprompt.bndl, and a latentmaker.bndl, and the sampler pulls model, VAE, conditioning, and latent out of the bundles itself. No six loose wires, no intermediate DeBNDLers. It also bundles a live latent preview during sampling and a built-in two-pass latent upscale, so it's a genuinely bigger node than the KSampler it replaces - for better and for worse.

How it works

Under the hood it constructs a standard ComfyUI KSampler and runs it, so everything you know about sampling applies. The Shima layer is in the plumbing around it:

  • Seed is s33d, not seed - the pack deliberately renames it so ComfyUI's automatic control_after_generate widget never silently re-rolls your seed out from under you. The randomize toggle handles random seeds explicitly. If a shima.commonparams bundle is connected with use_commonparams on, the bundle's seed overrides the widget.
  • Bundle overrides - modelcitizen.bndl supplies model + VAE, latentmaker.bndl supplies the latent, masterprompt.bndl supplies positive/negative. Each overrides its individual-wire counterpart. There's also panelinputs.bndl for the pack's Panel system.
  • Two-pass HiRes Fix is built in - turn on upscale_enabled and the node upscales the latent (nearest-exact/bilinear/area/bicubic/bislerp at upscale_factor) then runs a second sample pass at upscale_denoise/upscale_steps/upscale_cfg. One node does what normally takes a LatentUpscale + second KSampler + masking rig.
  • Live previews - with preview_method on auto/latents, it decodes latent previews during sampling (throttled to ~every 500ms plus the final step) and shows them inline, instead of a blank node until it finishes.

It raises loud, useful errors when you feed it nothing: "No Model provided!", "No Conditioning provided!", "No Latent Image provided!" - which makes wiring mistakes obvious fast.

The inputs that matter

  • model, positive, negative, latent - the classic four, or the equivalent .bndl inputs.
  • s33d / randomize - seed control.
  • steps, cfg, sampler_name, scheduler, denoise - the standard knobs; use_samplercommons lets a Shima Sampler Commons bundle override these.
  • upscale_enabled / upscale_factor / upscale_denoise / upscale_steps / upscale_cfg - the built-in HiRes Fix.
  • vae_decode - decode to an image (needs a VAE from the model, the vae input, or the model citizen bundle).
  • use_commonparams + shima.commonparams - pull seed/model-type from Shima.Commons.

The outputs

  • latent - the sampled latent.
  • image - the decoded image (a 64×64 placeholder if vae_decode is off).
  • s33d - the seed actually used, which matters when randomization or Commons picked it.
  • shimasampler.bndl - the result envelope (image + latent + used seed) for downstream Shima nodes.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/KDB-USJP/shima_wf.git Shima
pip install -r requirements.txt

Restart, then Shima/Sampling → Shima Sampler. ComfyUI Manager: search "Shima". On first boot the installer auto-clones ComfyUI-Impact-Pack and cg-use-everywhere if missing (the Use Everywhere dependency for island auto-linking) - expected.

Common issues

The big one is stale bundles. The sampler reads the bundle at execution time, so if you build a masterprompt.bndl before a LoRA or style node and never rebuild it, the sampler samples with the old conditioning and nothing looks broken - the snapshot rule from the plumbing essay in full effect. Second: use_commonparams defaults on, so a connected Commons bundle silently overrides your carefully typed seed and settings; if the sampler ignores your widget values, check what the Commons node is broadcasting. (use_samplercommons is off by default - Sampler Commons overrides only kick in when you switch it on.) Third, if image comes out as a 64×64 black box, vae_decode is on but no VAE reached the node - the model citizen bundle is the usual culprit. It's a new, niche pack with thin community coverage, so when behavior surprises you, the sample logic in nodes/sampler.py is clear enough to read end-to-end.

CategoryShima/Sampling

Inputs (35)

NameTypeDefaultDescription
s33dINT00–18446744073709550000Seed input (ignored if Randomize is True and Commons is unsued)
randomizeBOOLEANfalseIf True, generate a new random seed (ignored if using Commons)
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
denoiseFLOAT1.000–1
add_noiseBOOLEANtrueIf False, noise will not be added to the latent (useful for img2img with pre-noised latents)
start_at_stepINT00–10000Step to start sampling at (useful for img2img)
end_at_stepINT100000–10000Step to end sampling at (useful for partial sampling)
return_with_leftover_noiseBOOLEANfalseIf True, the latent will be returned with leftover noise if denoise < 1.0
preview_methodCOMBO3 options: auto, latents, none
vae_decodeBOOLEANtrueDecode latent to image (requires VAE)
upscale_enabledBOOLEANfalseEnable 2-pass latent upscaling (HiRes Fix)
upscale_methodCOMBOnearest-exact5 options: nearest-exact, bilinear, area, bicubic, bislerp
upscale_factorFLOAT1.501–4Multiplier for output resolution
upscale_denoiseFLOAT0.500–1Denoise strength for 2nd pass
upscale_stepsINT201–10000Steps for 2nd pass
upscale_cfgFLOAT8.00–100CFG for 2nd pass
positiveoptCONDITIONING
negativeoptCONDITIONING
latentoptLATENT
modeloptMODEL
shima.commonparamsoptDICTConfiguration bundle from Shima.Commons (overrides settings)
vaeoptVAEOptional VAE for decoding (if vae_decode is True and model doesn't have embedded VAE)
use_commonparamsoptBOOLEANtrueIf True, use settings from Shima.Commons bundle
allow_external_linkingoptBOOLEANfalseIf ON, this node broadcasts/receives OUTSIDE the Island (ignores group regex)
show_used_valuesoptBOOLEANfalseShow actual values being used (debug)
shima.samplercommonsoptDICTSampler settings bundle from Shima.SamplerCommons (overrides steps/cfg/sampler/scheduler/denoise)
use_samplercommonsoptBOOLEANfalseIf True, use sampler settings from SamplerCommons bundle
modelcitizen.bndloptBNDLBundle containing Model and VAE (overrides individual inputs)
latentmaker.bndloptBNDLBundle containing Latent Image (overrides individual inputs)
masterprompt.bndloptBNDLBundle containing Positive and Negative conditioning (overrides individual inputs)
panelinputs.bndloptBNDLOverrides panel settings using an external PanelBNDLer node
show_previewoptBOOLEANtrueShow/hide the built-in preview image display on this node

Outputs (4)

NameTypeDescription
latentLATENT
imageIMAGE
s33dINT
shimasampler.bndlBNDL