Extensions/ComfyUI-Binyuan-Latent-Helper
ComfyUI Extension

ComfyUI-Binyuan-Latent-Helper

ComfyUI custom node - quick empty-Latent generator with size presets (bilingual CN/EN)

By yjitiu·Created 2 months ago·Updated 2 months ago· 1
yjitiu/ComfyUI-Binyuan-Latent-Helper
Nodes1
On cloudLocal install
CategoryLatent助手
Stars1
Updated2 months ago
Readme

📏 ComfyUI Binyuan · Latent Helper(中文 Latent 快捷助手 v2.0)

A tiny ComfyUI custom node that generates an empty LATENT (and outputs the matching width/height) from a list of Chinese-labeled size presets — so you don't have to remember "1216×832" etc. Bilingual UI.

这是一个极简的单节点插件:用一个下拉预设快速生成空 Latent,同时把实际宽高作为整数端口输出,方便下游节点(如采样器)直接读取尺寸。带前端 JS,预设与宽高输入框联动。


中文说明

这是什么

节点 📏 binyuan · 中文Latent快捷助手 v2.0,分类 Latent助手。 按预设或自定义尺寸生成一个全零的空 Latent 张量(4 通道,[批次, 4, 高/8, 宽/8]),并把实际宽高作为 INT 端口输出。

怎么用

  1. 把插件放到 ComfyUI/custom_nodes/binyuan_latent_helper/,重启 ComfyUI。
  2. 右键画布 → Latent助手📏 binyuan · 中文Latent快捷助手 v2.0
  3. 选预设(如 1024x1024 (1:1 正方形))或选 自定义 后手填宽高。
  4. Latent 端口接到采样器的 latent 输入;宽度/高度 可接到需要尺寸的节点。

输入

| 参数 | 说明 | |---|---| | 预设选择 | 一组常用尺寸(正方形/竖屏/横屏/手机壁纸/2K/老模型 512 等)+ 自定义 | | 宽度 / 高度 | 64–8192,步长 8 | | 批次大小 | 1–64 | | 宽高对调 | 开启后宽高互换,输出的 宽度/高度 端口也同步为对调后的值 |

输出

  • Latent:空 Latent(LATENT)
  • 宽度 / 高度:实际生效的宽高(INT,对调时为互换后的值)

注意

生成的是 4 通道空 Latent,适合 SD1.5 / SDXL 等 4 通道模型;Flux 等 16 通道模型请用对应加载器自带的空 Latent。 <img width="401" height="417" alt="屏幕截图 2026-07-01 115347" src="https://github.com/user-attachments/assets/a346da76-169b-4ae0-86c5-e5d40c92becf" />


English

What it is

Node 📏 binyuan · 中文Latent快捷助手 v2.0 under category Latent助手. Generates an all-zero empty Latent ([batch, 4, H/8, W/8]) from a preset or custom size, and also returns the effective width/height as integer ports.

How to use

  1. Drop into ComfyUI/custom_nodes/binyuan_latent_helper/ and restart ComfyUI.
  2. Right-click canvas → Latent助手 → add the node.
  3. Pick a preset (e.g. 1024x1024 (1:1 正方形)) or choose 自定义 and type W/H.
  4. Connect the Latent port to a sampler's latent input; 宽度/高度 feed any node that needs the size.

Inputs

预设选择 (preset list), 宽度/高度 (64–8192, step 8), 批次大小 (1–64), 宽高对调 (swap W/H — outputs reflect the swapped values).

Outputs

Latent (LATENT), 宽度/高度 (INT — the effective size after any swap).

Note

Produces a 4-channel empty Latent (SD1.5 / SDXL style). For 16-channel models like Flux, use the loader's own empty-Latent node.


文件结构 / Files

  • __init__.py — node definition & registration (WEB_DIRECTORY = "js")
  • js/chicun.js — frontend: syncs the preset dropdown with W/H inputs
  • README.md / LICENSE (MIT)

安装 / Install

  • ComfyUI Manager:搜索 Binyuan Latent Helper,或手动 git clonecustom_nodes/
  • Manual: git clone https://github.com/yjitiu/ComfyUI-Binyuan-Latent-Helper.git binyuan_latent_helper