Shima Sampler
A KSampler that eats bundles and does HiRes Fix
- positive
- negative
- latent
- model
- shima.commonparams
- vae
- shima.samplercommons
- modelcitizen.bndl
- latentmaker.bndl
- masterprompt.bndl
- panelinputs.bndl
- latent
- image
- s33d
- shimasampler.bndl
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, notseed- the pack deliberately renames it so ComfyUI's automaticcontrol_after_generatewidget never silently re-rolls your seed out from under you. Therandomizetoggle handles random seeds explicitly. If ashima.commonparamsbundle is connected withuse_commonparamson, the bundle's seed overrides the widget. - Bundle overrides -
modelcitizen.bndlsupplies model + VAE,latentmaker.bndlsupplies the latent,masterprompt.bndlsupplies positive/negative. Each overrides its individual-wire counterpart. There's alsopanelinputs.bndlfor the pack's Panel system. - Two-pass HiRes Fix is built in - turn on
upscale_enabledand the node upscales the latent (nearest-exact/bilinear/area/bicubic/bislerp atupscale_factor) then runs a second sample pass atupscale_denoise/upscale_steps/upscale_cfg. One node does what normally takes a LatentUpscale + second KSampler + masking rig. - Live previews - with
preview_methodon 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.bndlinputs.s33d/randomize- seed control.steps,cfg,sampler_name,scheduler,denoise- the standard knobs;use_samplercommonslets 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, thevaeinput, 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 ifvae_decodeis 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.
Inputs (35)
| Name | Type | Default | Description |
|---|---|---|---|
| s33d | INT | 00–18446744073709550000 | Seed input (ignored if Randomize is True and Commons is unsued) |
| randomize | BOOLEAN | false | If True, generate a new random seed (ignored if using Commons) |
| steps | INT | 201–10000 | — |
| cfg | FLOAT | 8.00–100 | — |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 | |
| denoise | FLOAT | 1.000–1 | — |
| add_noise | BOOLEAN | true | If False, noise will not be added to the latent (useful for img2img with pre-noised latents) |
| start_at_step | INT | 00–10000 | Step to start sampling at (useful for img2img) |
| end_at_step | INT | 100000–10000 | Step to end sampling at (useful for partial sampling) |
| return_with_leftover_noise | BOOLEAN | false | If True, the latent will be returned with leftover noise if denoise < 1.0 |
| preview_method | COMBO | 3 options: auto, latents, none | |
| vae_decode | BOOLEAN | true | Decode latent to image (requires VAE) |
| upscale_enabled | BOOLEAN | false | Enable 2-pass latent upscaling (HiRes Fix) |
| upscale_method | COMBO | nearest-exact | 5 options: nearest-exact, bilinear, area, bicubic, bislerp |
| upscale_factor | FLOAT | 1.501–4 | Multiplier for output resolution |
| upscale_denoise | FLOAT | 0.500–1 | Denoise strength for 2nd pass |
| upscale_steps | INT | 201–10000 | Steps for 2nd pass |
| upscale_cfg | FLOAT | 8.00–100 | CFG for 2nd pass |
| positiveopt | CONDITIONING | — | |
| negativeopt | CONDITIONING | — | |
| latentopt | LATENT | — | |
| modelopt | MODEL | — | |
| shima.commonparamsopt | DICT | Configuration bundle from Shima.Commons (overrides settings) | |
| vaeopt | VAE | Optional VAE for decoding (if vae_decode is True and model doesn't have embedded VAE) | |
| use_commonparamsopt | BOOLEAN | true | If True, use settings from Shima.Commons bundle |
| allow_external_linkingopt | BOOLEAN | false | If ON, this node broadcasts/receives OUTSIDE the Island (ignores group regex) |
| show_used_valuesopt | BOOLEAN | false | Show actual values being used (debug) |
| shima.samplercommonsopt | DICT | Sampler settings bundle from Shima.SamplerCommons (overrides steps/cfg/sampler/scheduler/denoise) | |
| use_samplercommonsopt | BOOLEAN | false | If True, use sampler settings from SamplerCommons bundle |
| modelcitizen.bndlopt | BNDL | Bundle containing Model and VAE (overrides individual inputs) | |
| latentmaker.bndlopt | BNDL | Bundle containing Latent Image (overrides individual inputs) | |
| masterprompt.bndlopt | BNDL | Bundle containing Positive and Negative conditioning (overrides individual inputs) | |
| panelinputs.bndlopt | BNDL | Overrides panel settings using an external PanelBNDLer node | |
| show_previewopt | BOOLEAN | true | Show/hide the built-in preview image display on this node |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| image | IMAGE | — |
| s33d | INT | — |
| shimasampler.bndl | BNDL | — |