Bernini-R KSampler
Context windows, seven guidance modes, TeaCache, block swap
- model_handle
- positive
- negative
- latent_image
- context_options
- guidance_config
- block_swap_args
- teacache_args
- guidance_schedule
- latent
This is the hub of the whole pack. Where a stock ComfyUI KSampler takes a MODEL, this one takes a BERNINI_MODEL_HANDLE, and on top of normal sampling it can layer temporal context windows for long videos, a seven-mode guidance family, TeaCache acceleration, and GPU↔CPU block swapping. Disconnect all of those optional wires and it behaves like a normal KSampler - a good mental model for how to approach it: build the plain graph first, then bolt on the knobs one at a time.
How it works
The sampler loads the model through the lazy handle (weights hit GPU only when sampling starts), prepares noise, and delegates to the pack's internal sampling machinery. Every optional input is just a config object that switches machinery on: context_options enables windowed sampling for long videos, teacache_args installs block-skipping hooks, block_swap_args offloads transformer blocks to CPU, guidance_config replaces plain CFG with one of the fancier guidance strategies, and guidance_schedule overrides the static cfg with a per-step curve.
The inputs that matter
Required: model_handle, seed, positive/negative (CONDITIONING), latent_image, and the sampling trio:
- steps - 20-40 for flow matching. Bernini-R typically wants 20+; editing can get away with fewer.
- cfg - 4-7 typical for video, default 6. Overridden entirely if you connect a
guidance_schedule. - sampler_name / scheduler -
uni_pcoreulerwithsimpleornormalwork well with flow matching, per the tooltips.flow_shiftdefaults to 3.0, which is what Bernini-R was trained with - higher shifts more steps toward low noise for sharper detail.
The optional wires, in the order you should add them:
- context_options (from
BerniniR_ContextWindow) - the long-video VRAM solution. - teacache_args (from
BerniniR_TeaCacheArgs) - the speed solution. - block_swap_args (from
BerniniR_BlockSwapArgs) - the "I refuse to buy more VRAM" solution. - guidance_config and guidance_schedule - quality tuning.
One input that trips people up: add_noise. Disable it for img2vid when denoise < 1.0 - otherwise you add fresh noise on top of an encoded image that's already meant to be preserved.
Output
One: latent (LATENT), which goes to BerniniR_VAEDecode. Standard.
Common issues, honestly
The README's troubleshooting list maps neatly onto this node. Gray or noisy frames → your guidance_schedule is mis-wired; guidance is applied in noise-residual space, not denoised space, so a wrong curve reads as washed-out video. OOM during sampling → lower context_frames, drop resolution, set force_offload in the prompt planner, or connect block swap. Seams between windows → raise context_overlap, switch fuse_method to pyramid, or use uniform_standard instead of static_standard.
And the meta-advice for this pack specifically: it's a self-contained alternative to Kijai's mainline ComfyUI Bernini integration, and it's newer and less battle-tested. The model underneath is the same - that 2x-compute editing cost, the 81-frame native window, no audio, no FLF - but if something behaves oddly here, the first diagnostic step is to disconnect all the optional config wires and confirm the plain sampling path works. Then add back one knob at a time.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| model_handle | BERNINI_MODEL_HANDLE | Bernini-R model handle from BerniniR_ModelLoader | |
| seed | INT | 00–18446744073709550000 | Random seed for reproducible generation |
| steps | INT | 201–10000 | Number of denoising steps. 20-40 for flow matching |
| cfg | FLOAT | 6.00–100 | Classifier-free guidance scale. 4-7 typical for video |
| sampler_name | COMBO | Sampling algorithm. 'uni_pc' or 'euler' work well with flow matching | |
| scheduler | COMBO | Sigma schedule. 'simple' or 'normal' recommended | |
| positive | CONDITIONING | Positive prompt conditioning | |
| negative | CONDITIONING | Negative prompt conditioning | |
| latent_image | LATENT | Input latent (noise or encoded image for img2vid) | |
| denoise | FLOAT | 1.000–1 | Denoising strength. 1.0 = full generation, <1.0 = img2vid |
| flow_shift | FLOAT | 3.00.1–100 | Sigma schedule shift. Bernini-R trained with 3.0. Higher = more low-noise steps, sharper details |
| context_optionsopt | BERNINI_CTX | Context window config from BerniniR_ContextWindow. Connect to enable temporal window tiling for long videos. | |
| guidance_configopt | BERNINI_GUIDANCE_CONFIG | Guidance strategy + params from BerniniR_GuidanceConfig. Leave disconnected for plain CFG. | |
| block_swap_argsopt | BERNINI_BLOCKSWAP | Block swap config from BerniniR_BlockSwapArgs. Leave disconnected to disable. | |
| teacache_argsopt | BERNINI_TEACACHE | TeaCache config from BerniniR_TeaCacheArgs. Leave disconnected to disable TeaCache. | |
| add_noiseopt | BOOLEAN | true | Add initial noise. Disable for img2vid when denoise < 1.0 |
| guidance_scheduleopt | BERNINI_GUIDANCE | Dynamic per-step guidance scale from BerniniR_GuidanceStrengthSchedule. Overrides static cfg. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |