🛡️ Binyuan Sampler V2.3 EN|中英双语版
Loader, Prompt Box, KSampler and VAE Decode in One Node
- external_model
- external_clip
- external_vae
- external_latent
- external_sigmas
- external_positive
- external_negative
- lora_settings
- upstream_image_1
- upstream_image_2
- upstream_image_3
- IMAGE / 图像
- MODEL / 模型
- CLIP
- VAE
- LATENT / Latent
- POSITIVE / 正面条件
- NEGATIVE / 负面条件
- DENOISED / 降噪Latent
If you've stared at a 30-node ComfyUI graph and thought "this is four wires and a tin of noodles," the Binyuan sampler is aimed at you. It's one node - class BinyuanUltimateSamplerEN, display name 🛡️ Binyuan Sampler V2.2 EN|中英双语版, category Binyuan - that loads a checkpoint or a split stack, encodes both prompts, builds the latent, samples, decodes, and hands you a finished IMAGE. It also exposes model, CLIP, VAE, conditioning and latents as outputs so you can chain it into a second stage.
This is the bilingual build; the Chinese edition uses a different node key, so both can live side by side. It's MIT and declares zero dependencies, which is rare for a pack with this much surface area.
Why the all-in-one shape exists
This is the context-bus pattern: instead of dragging model, clip, vae, conditioning, latent, size, steps and seed across the graph as a dozen parallel wires, you bundle them. Efficiency Nodes popularized it, ComfyUI-Easy-Use threads a pipe dict - same idea, bigger surface. The payoff is legibility. The failure mode is stale contents: when one node holds everything, it's easy to run base weights while believing a LoRA is applied. Binyuan's loader lives inside the sampler, so nothing gets unpacked out of order - but the LoRA panel, chaining mode and latent source decide what's inside the bundle, and you have to read them.
How it works
Two load modes. Checkpoint (whole file) picks a baked checkpoint. Separate (Flux/SD3/Diffusion) takes a diffusion model, clip_1, optional clip_2, a vae (default baked_vae) and a clip_type from a 30-entry list - flux, flux2, krea2, hidream, hunyuan_image, chroma and friends. .gguf files show up in those dropdowns because the node dynamically imports City96's ComfyUI-GGUF rather than vendoring it.
Sampling runs on ComfyUI's public API: 44 samplers (euler default), 9 schedulers (simple default), and a weight_precision cast (fp8_e4m3fn, nvfp4, bf16…). Prompt boxes support {a|b|c} dynamic prompts drawn from the seed.
One genuinely unusual knob: attention_backend, defaulting to Auto safe. For a Krea2 or Qwen-Image-2.1 model loaded by this node it can pick Comfy Kitchen when available, otherwise ComfyUI's sub-quadratic backend - a model-local patch, not a startup flag, so models wired in from elsewhere keep their own setup.
The controls you'll actually touch
- load_mode / checkpoint / diffusion_model / clip_type / vae - your model.
clip_typemust match the architecture; a mismatch is the classic "why is my conditioning garbage" cause. - positive_prompt / negative_prompt - plain text boxes,
{a|b|c}supported. - steps, cfg, sampler, scheduler, denoise, seed, width, height, batch_size - the usual.
cfgdefaults to 1 andflux_guidanceto 3.5, right for distilled models: at exactly 1 ComfyUI skips the negative pass rather than weighting it to zero. - chaining_mode -
Own model,Inherit upstream,Auto detect.Inherit upstreamreusesexternal_model/external_clip/external_vae, so a second sampler doesn't load the weights twice. - latent_source -
Empty latent,External latent first,Upstream image first,Stitch upstream images. The olderupstream_image_handlingwidget is kept only for workflow compatibility;latent_sourcedrives behavior. - lora_json - the
+ Add LoRApanel writes here, but it also parses plain text (name.safetensors:0.8, one per line,#comments) or a JSON array with per-model and per-CLIP strengths.
Outputs, in order: IMAGE, MODEL, CLIP, VAE, LATENT, POSITIVE, NEGATIVE, DENOISED. IMAGE into SaveImage is the whole beginner workflow; feed MODEL/CLIP/VAE/LATENT into a second Binyuan node to skip a reload. Two newer clusters: advanced_sampling turns steps into a total schedule and makes start_at_step / end_at_step / add_noise / return_with_leftover_noise authoritative (denoise is ignored there), and noise_strength (0–2) scales initial noise in both modes. For Qwen-Image-2.1, qwen_edit_mode plus qwen_reference_resolution: native reference editing starts from an empty latent so the node pins denoise to 1.0, while VAE redraw keeps the source canvas and takes 0.25–0.55 happily.
Install
ComfyUI Manager → search "Binyuan Sampler". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/yjitiu/ComfyUI-Binyuan-Sampler-EN
# restart ComfyUI, then hard-refresh the browser (Ctrl+F5)
The folder name doesn't matter; the folder's contents do. Keep __init__.py, js/, locales/, LICENSE and pyproject.toml - copying just the Python file loses the LoRA panel and the labels. After updating, restart the backend and refresh, then re-add the node if the new widgets still aren't there.
No models ship with it. .gguf support needs ComfyUI-GGUF in custom_nodes/ComfyUI-GGUF. Qwen-Image-2.1 needs a core with TextEncodeQwenImage21, the matching text encoder, and the 64-channel Qwen VAE.
Where people get burned
The attention error that isn't this node's fault. If sampling dies with No operator found for memory_efficient_attention_forward ... requires device with capability <= (9, 0) but your GPU has capability (12, 0), you have xformers installed and its prebuilt kernels don't cover your GPU. Every sampling node fails the same way, stock KSampler included. Fix it at launch:
python main.py --use-pytorch-cross-attention --disable-xformers
Cross-family latents. Flux/Krea and Qwen latents differ in channel count and scaling. Don't pass LATENT between them just because the sockets are the same color - pass IMAGE and let the second model re-encode it.
Knobs that look dead. Low denoise on an empty latent gets protected back to 1; denoise does nothing in advanced mode; noise_strength does nothing there when add_noise is off; a connected external_sigmas overrides steps, scheduler and denoise; end_at_step <= start_at_step skips sampling entirely. And if the step count arrives on a wire from a shared integer, editing the node's own box changes nothing.
Finally: don't install two copies of the same bilingual node ID, and back up custom_nodes before updating. This is a young single-author pack with no cross-version compatibility guarantee.
Inputs (52)
| Name | Type | Default | Description |
|---|---|---|---|
| load_mode | COMBO | Checkpoint (whole file) | 整包Checkpoint | 2 options: Checkpoint (whole file) | 整包Checkpoint, Separate (Flux/SD3/Diffusion) | 分离式(Flux/SD3/扩散) |
| checkpoint | COMBO | None | 1 options: None |
| diffusion_model | COMBO | None | 1 options: None |
| clip_1 | COMBO | None | 1 options: None |
| clip_2 | COMBO | None | 1 options: None |
| clip_type | COMBO | flux | 32 options: ACE, boogu, chroma, cogvideox, cosmos, flux, +26 |
| vae | COMBO | baked_vae | 1 options: baked_vae |
| weight_precision | COMBO | default | 9 options: default, fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2, nvfp4, pid, +3 |
| chaining_mode | COMBO | Inherit upstream | 继承上游模型 | 3 options: Own model | 使用自身模型, Inherit upstream | 继承上游模型, Auto detect | 自动检测 |
| upstream_image_handling | COMBO | Re-encode with VAE | 重新VAE编码 | 3 options: Re-encode with VAE | 重新VAE编码, Use directly as latent | 直接作为Latent, Auto | 自动选择 |
| latent_source | COMBO | Upstream image first | 上游图像优先 | 4 options: Empty latent | 空Latent, External latent first | 外部Latent优先, Upstream image first | 上游图像优先, Stitch upstream images | 上游图像拼接 |
| positive_prompt | STRING | masterpiece, best quality, 1girl | 支持 {a|b|c} 动态提示词抽签:每次点 Run 重新随机抽一个。网页点 Run 由前端抽签;连线传入或 API/外部调用由节点在服务端抽签。{ } 必须成对,选项之间用半角竖线 | 。 |
| negative_prompt | STRING | 同上,负向提示词同样支持 {a|b|c} 抽签。 | |
| size_preset | COMBO | Custom | 自定义 | 25 options: Custom | 自定义, 512x512, 512x768, 768x512, 768x768, 768x1024, +19 |
| width | INT | 102464–8192 | — |
| height | INT | 102464–8192 | — |
| batch_size | INT | 11–100 | — |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 201–100 | — |
| cfg | FLOAT | 1.00–20 | — |
| flux_guidance | FLOAT | 3.50–10 | — |
| sampler | COMBO | euler | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 |
| scheduler | COMBO | simple | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 |
| denoise | FLOAT | 1.000–1 | — |
| lora_json | STRING | [] | — |
| lora_list | COMBO | 1 options: None | |
| cleanup_vram | BOOLEAN | false | — |
| external_modelopt | MODEL | — | |
| external_clipopt | CLIP | — | |
| external_vaeopt | VAE | — | |
| external_latentopt | LATENT | — | |
| external_sigmasopt | SIGMAS | — | |
| external_positiveopt | CONDITIONING | — | |
| external_negativeopt | CONDITIONING | — | |
| lora_settingsopt | BINYUAN_LORA_SETTINGS | — | |
| upstream_image_1opt | IMAGE | — | |
| upstream_image_2opt | IMAGE | — | |
| upstream_image_3opt | IMAGE | — | |
| moss_model_pathopt | STRING | Local MOSS HF/Diffusers directory; select clip_type=moss_image. Empty uses separate model/clip/VAE dropdowns. / 本地完整模型目录,留空使用分离权重。 | |
| moss_text_deviceopt | COMBO | default | 2 options: default, cpu |
| moss_shiftopt | FLOAT | 5.00.01–100 | — |
| moss_uncond_skip_layersopt | STRING | 22 | MOSS negative-branch layer skipping; empty disables. / 负分支跳层,留空关闭。 |
| flux3_edit_modeopt | COMBO | Auto | FLUX 3 Auto/Native: upstream images become references, with an empty output canvas. VAE redraw: initial image latent and adjustable denoise. / 自动或原生编辑使用参考条件与空画布;VAE重绘使用初始图像Latent,可调重绘强度。 |
| qwen_reference_resolutionopt | INT | 10240–4096 | Qwen-Image-2.1 reference pixel budget (resolution squared); 0 keeps original size, aligned to 32. Editing output follows the first reference. / Qwen-Image-2.1 参考图像素预算(分辨率平方);0 保持原尺寸并对齐32,编辑输出尺寸跟随第一张参考图。 |
| qwen_edit_modeopt | COMBO | Auto | 自动 | Auto keeps existing workflows compatible. Native reference edit uses Qwen-Image-2.1 official reference conditioning and an empty latent (denoise is fixed to 1). VAE redraw encodes the upstream image as the initial latent, preserves its canvas (32-pixel alignment), and enables adjustable denoise. / 自动模式兼容旧工作流;原生参考编辑使用官方参考条件与空Latent(重绘强度固定为1);VAE传统重绘把上游图像编码为初始Latent,保持画布(对齐32)并允许调节重绘强度。 |
| attention_backendopt | COMBO | Auto safe | 自动稳定 | Auto safe uses Comfy Kitchen for internally loaded Krea2/Qwen-Image-2.1 models when available, otherwise ComfyUI's sub-quadratic backend; other models and externally patched models retain their backend. Core default follows ComfyUI startup flags. / 自动稳定为内部加载的Krea2/Qwen-Image-2.1模型选用可用的Comfy Kitchen,否则使用内核分块后端;其他模型与已外接修补的模型保持原后端。内核默认遵循启动参数。 |
| advanced_samplingopt | BOOLEAN | false | Advanced step range; steps becomes total schedule steps, denoise is ignored. / 高级分段:步数为总步数,忽略重绘强度。 |
| start_at_stepopt | INT | 00–10000 | Zero-based start; 10 starts after the first 10 steps. / 从0计数;10表示跳过前10步。 |
| end_at_stepopt | INT | 100000–10000 | Stop boundary, clamped to total steps. / 结束边界;超过总步数即运行到最后。 |
| add_noiseopt | BOOLEAN | true | Disable when continuing an upstream noisy LATENT. / 接续上游带噪LATENT时关闭;成图重绘时开启。 |
| return_with_leftover_noiseopt | BOOLEAN | false | Enable for the first segment; pass LATENT, not denoised_latent, to the next sampler. / 第一段开启,把LATENT传给下一段,不要传去噪Latent。 |
| noise_strengthopt | FLOAT | 1.000–2 | Initial random-noise multiplier in both modes: 1=normal, 0=no added initial noise. Advanced Add noise OFF overrides this. Does not change sigma schedule or remove existing noise. / 两种模式均有效:1为标准新增噪声,0不新增初始噪声;高级模式关闭添加噪声时本项无效。不改变采样日程,不消除输入已有噪声。 |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| IMAGE / 图像 | IMAGE | — |
| MODEL / 模型 | MODEL | — |
| CLIP | CLIP | — |
| VAE | VAE | — |
| LATENT / Latent | LATENT | — |
| POSITIVE / 正面条件 | CONDITIONING | — |
| NEGATIVE / 负面条件 | CONDITIONING | — |
| DENOISED / 降噪Latent | LATENT | — |