Nodes/JosiaNodes/Josia媒体保存
ComfyUI Node

Josia媒体保存

The one output node that saves PNG, MP4, FLAC and .latent — and decodes the latent itself

By Josia-doit·Created 6 months ago·Updated a day ago· 18
Josia媒体保存
  • 图像
  • Latent
  • Video_VAE
  • Audio_VAE
  • 视频
  • 音频
  • 图像
  • 路径
  • Latent
  • Video_Latent
  • Audio_Latent
filename_prefixJosiaMedia\Pic_%001%
图像格式⭐ PNG
无损true
质量90
压缩级别4
视频容器
帧率24.00
视频编码h264
视频质量23
输出帧率0.00
音频格式
音频质量128k
保存潜空间false
解码方式自动
分块尺寸512
分块重叠64
时间分块64
时间重叠8
解码精度自动
清理缓存
清理时机解码前
写入元数据true
临时预览false
VAE1🎨 请选择模型…
VAE2🎵 请选择模型…

Every ComfyUI workflow ends in the same pile of output nodes: Save Image here, Save WEBM there, Save Audio for the soundtrack, VAE Decode before any of it because the sampler hands you a latent, not pixels. Josia媒体保存 collapses that pile into one node - and then does one thing the native nodes don't.

Why you'd bother

Three reasons, in order of how much they matter.

The latent gets written before the decode. Decoding is the memory spike; everything upstream is a tensor a fraction of the size. With 保存潜空间 on, this node saves the .latent first, then decodes. If the decode OOMs - what usually kills a big video or high-res run - the run isn't wasted: load it back with Josia加载Latent, free VRAM, decode separately.

You can skip the separate decode. Wire Latent plus a VAE in and it decodes internally, with 解码方式 (自动 / 直接解码 / 分块解码) covering the case where the plain decode won't fit. On a small card that's one node instead of two, and the tiled path replicates ComfyUI's VAEDecodeTiled semantics exactly (troubleshooting.md for why VRAM ceilings bite here). 图像 also passes straight through, so this drops in where Save Image already sits.

Inputs a beginner actually sets

filename_prefix defaults to JosiaMedia\Pic_%001% - writes to output/JosiaMedia/ as Pic_001, Pic_002. %001% is the counter placeholder, substituted in place: shot%0001%_raw gives shot0007_raw. %date%, %time%, %date:yyyyMMdd% and %time:hhmm% work too, same rules as ComfyUI's own prefix templating (image-io-metadata.md). Leave a counter out and you get an automatic _0001 suffix; same-name files never overwrite.

图像格式 lists 15 options, and formats your environment can't write are hidden rather than offered and then failing - AVIF, HEIF and JPEG XL only appear once a Pillow plugin provides them. A ⭐ before the name means that format carries workflow metadata. 视频容器 is 关 / MP4 / MKV / WebM / GIF / APNG / 动图WebP, synthesised from an image batch at the given fps; codecs the container can't hold (h264 into WebM) get swapped for its default instead of erroring. Audio is FLAC / WAV / MP3 / Opus with a bitrate ladder.

VAE1 is where this node plays nicely with its sibling: the default is 使用Josia模型加载VAE, which reuses whatever VAE the pack's model-loader node already loaded, with no wire. Wire the Video_VAE port and the dropdown greys out - wiring wins.

解码精度 (自动 / fp32 / fp16 / bf16) is the knob people never look for and always need: fp32 is the standard fix for black images and snow from a VAE decode (troubleshooting.md). 清理缓存 (关/轻度/深度, before or after decoding) reclaims only unreferenced tensors and CUDA free blocks - it never unloads your models, so repeat runs don't get slower.

Outputs: 图像 (your image, or the decoded result), 路径 (the main file's relative path, handy for a string node), Latent (pass-through, for two-sampler workflows), plus Video_Latent and Audio_Latent split out of a joint AV latent, None when there isn't one.

Install

ComfyUI Manager, search ComfyUI_JosiaNodes, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Josia-doit/ComfyUI_JosiaNodes
# restart ComfyUI

Restart and check the console for a [JosiaNodes] ✅ line. There's no model to download - it uses your VAE. requirements.txt is empty, and that's mostly honest: image, audio and latent saving run on Pillow, torch and the standard library. Video is the exception - MP4/MKV/WebM go through PyAV, which ComfyUI's own video nodes install, so a full desktop install already has it. If you get 未安装 PyAV(av),无法写出视频, that's the missing piece, not a broken node.

The author's README is upfront that the pack ships mainly via GitHub and doesn't promise passage through the registry's automatic security scan, so if Manager can't find it, clone it manually. Normal custom-node rules: no review, no sandboxing (comfyui-ecosystem.md).

Common issues

"接了「Latent」但没有接「Video_VAE」,无法解码。" You fed it a latent with no VAE anywhere. Either wire one, or set VAE1 to 使用Josia模型加载VAE and make sure the model-loader node has actually run once.

Audio-only video models go half-silent. For LTX-2 / MiniMax-style av models the latent is a joint audio+video container, and both paths decode independently (ltx-video.md). No audio VAE set means the video saves and the audio is dropped - with an explicit console warning, not silently. Set VAE2, or wire Audio_VAE.

OOM on the decode. 解码方式 = 自动 already retries tiled after a CUDA OOM. To aim it, the tooltip's guidance is a 512 tile on 8GB, 256–384 on 6GB, with 64px overlap. For fragmentation, set 清理缓存 to 深度 with timing 解码前.

It re-saves on every queue. Correct behaviour - as an output node with a NaN change key, it must always run. The flip side: a quick iteration session quietly fills output/JosiaMedia/ with forty near-identical PNGs. Set 临时预览 on while you're fiddling; it writes a level-1 compressed copy to temp/, matching Preview Image.

One thing it won't do: the metadata it writes is ComfyUI's prompt/workflow block, not the A1111-style parameters string CivitAI wants (image-io-metadata.md).

Category⚡️JosiaNodes

Inputs (31)

NameTypeDefaultDescription
filename_prefixSTRINGJosiaMedia\Pic_%001%文件名前缀,可含子目录与通配符。 • 默认 `JosiaMedia\Pic_%001%` = 写到 output\JosiaMedia\ 下,文件名 Pic_001 / Pic_002 …(`%001%` 是 3 位序号占位,写在哪个位置就替换在哪个位置)。 • 想换层就改前缀里的目录部分(如 `JosiaMedia\视频\A_%0001%`),「📂 打开」会直接定位到那一层。 • 时间占位:%date% / %time% / %date:yyyyMMdd% / %time:hhmm%。 • 不写序号占位时,自动在名字后面补「_ + 4 位序号」。
图像格式COMBO⭐ PNG⭐ = 支持写入工作流元数据。仅列出当前环境真的能保存的格式。
无损BOOLEANtrue无损模式=像素逐位一致(体积最大、最慢);质量模式=按「质量」编码(体积小得多)。仅对支持无损的格式生效(PNG / WebP / AVIF / HEIF / JPEG XL / TIFF / JPEG 2000)。PNG 恒无损,本开关对它无意义。
质量INT901–100「质量模式」下的画质(越高越好、文件越大)。「无损模式」忽略此项。
压缩级别INT40–9PNG / APNG 压缩级别,原生 Save Image 默认 4。
视频容器COMBO由图像批次合成视频;接 VIDEO 输入时也会按此容器转存。'关' 表示不输出视频。
帧率FLOAT24.000.01–1000每秒播放多少张图(=每张图停留 1/帧率 秒):1 ⇒ 每张 1 秒,0.2 ⇒ 每张 5 秒,0.1 ⇒ 每张 10 秒 —— 用图片做幻灯片就调小它。原生 Save WEBM 默认 24、动图默认 6。
视频编码COMBOh264容器放不下的编码会自动换成该容器的默认编码。
视频质量INT230–63CRF:数值越小画质越高、文件越大(原生 Save WEBM 默认 32)。
输出帧率FLOAT0.000–1000仅视频 / 动图容器生效:实际**输出**的帧率(播放时的帧数)。 • 0(默认)=跟随「帧率」,不转换。 • 大于 0=把源帧按输出帧率重采样:输出帧数 = 源帧数 × 输出帧率 ÷ 输入帧率。 例① 图片以「帧率=1」做 1 张图 → 输出帧率=24 ⇒ 该图被拆成 24 帧、合成 1 秒视频; 例② MiniMax 视频 24fps → 输出 16 或 30 ⇒ 自动抽帧 / 复制前帧。 (轻量化实现=复制 / 抽帧,不插帧;真·运动插帧需 RIFE 等重模型,不在本节点范畴。)
音频格式COMBO接入音频时按此格式落盘:FLAC(无损)/ MP3 / Opus。
音频质量COMBO128k有损音频码率;FLAC 忽略此项。
保存潜空间BOOLEANfalse额外把潜空间存成 .latent 文件(与原生 Save Latent 同格式)。
解码方式COMBO自动自动 = 先直接解码,显存不够(OOM)时自动改用分块解码重试。
分块尺寸COMBO512分块解码的块大小(像素),原生 VAEDecodeTiled 默认 512。8G 显存建议 512,6G 建议 256~384。
分块重叠COMBO64相邻分块之间的空间重叠像素,用来消除拼接接缝(原生默认 64)。越大越平滑、越慢。
时间分块COMBO64仅视频 VAE 生效:一次解码多少帧(原生默认 64)。
时间重叠COMBO8仅视频 VAE 生效:帧与帧之间的重叠帧数,消除时间方向的闪烁/接缝(原生默认 8)。
解码精度COMBO自动强制 VAE 解码精度,专治黑图/雪花。fp32 最稳但最吃显存。
清理缓存COMBO只回收无引用张量与 CUDA 空闲块,绝不卸载已加载模型,热启动不降速。
清理时机COMBO解码前解码前清理可降低解码峰值显存;解码后清理可为下一次运行腾空间。
写入元数据BOOLEANtrue把工作流写入文件(PNG 私有块 / 其他格式的 EXIF UserComment)。
临时预览BOOLEANfalse对齐原生 Preview Image:写临时目录、前缀加 _temp_ 随机串、压缩级别 1。
VAE1COMBO🎨 请选择模型…解码用的主 VAE。 • 「使用Josia模型加载VAE」= 直接复用「Josia模型加载」节点已载入的 VAE,**不需要连线**(出厂默认)。 • 也可手动从 models/vae 里选一个,此时会按所选文件另行加载。 • 一旦给「Video_VAE」端口接了线,本项自动灰化 —— 接线优先。 • 备注:多个模型加载节点共存时,以最近一次加载的为准。
VAE2COMBO🎵 请选择模型…解码**音频路**潜空间用的 VAE(LTX / MiniMax H3 等双 VAE 模型)。 • 默认「🎵 请选择模型…」= 不使用音频 VAE,音频路不会解码。 • 想同时保存音频时,在这里选模型,或在「Audio_VAE」端口连线。 • 与 VAE1 完全独立:VAE1 保持默认也能单独指定音频 VAE。
图像optIMAGE直接保存的图像(像原生 Save Image),同时继续透传给下游。
LatentoptLATENT潜空间。本节点自带 VAE 解码,无需再接 VAE Decode 节点。 • 双 VAE 视频模型(LTX / MiniMax H3 等)的联合 AV 潜空间会自动分离: 视频路用 VAE 解码、音频路用「Audio_VAE」解码,不会只解一半。
Video_VAEoptVAE解码「Latent」用的主 VAE(视频路)。 • 接了这里 ⇒ 下方 VAE1 下拉自动灰化,以接线为准。 • 不接也可以:VAE1 选「使用Josia模型加载VAE」即可直接复用模型加载节点载入的 VAE。
Audio_VAEoptVAE解码「Latent」里**音频路**用的 VAE(LTX / MiniMax H3 等双 VAE 模型)。 • 接了这里 ⇒ 下方 VAE2 下拉自动灰化。 • 潜空间里检测到音频路、但这里没接 VAE 时会明确告警,而不是静默丢掉音频。
视频optVIDEO已有的视频对象,按所选容器原样转存。
音频optAUDIO要落盘的音频。

Outputs (5)

NameTypeDescription
图像IMAGE透传给下游的图像(「图像」或「Latent」解码后的结果)。
路径STRING本次落盘的主文件路径(相对 ComfyUI 输出目录)。
LatentLATENT原样透传输入 Latent(与旧版「潜空间」同名输出等价),便于双采样器等工作流二次利用。
Video_LatentLATENT从输入 Latent 拆出的**视频路**潜空间(联合 AV 潜空间 unbind()[0];非 AV 时为 None)。
Audio_LatentLATENT从输入 Latent 拆出的**音频路**潜空间(联合 AV 潜空间 unbind()[-1] / 纯音频潜空间;非 AV 时为 None)。