ComfyUI Node

Save DDS Image

Save DDS textures with real format control — BC1 to BC7, mipmaps included

By lilquail·Created 9 months ago·Updated 9 months ago· 1
Save DDS Image
  • images
    filename_prefixComfyUI
    formatBC3_UNORM
    output_color_spacesRGB
    output_path
    mipmap_levelsFull Chain
    mipmap_filterBox
    preserve_alpha_coverage0.0
    gpu_adapterAuto (GPU 0)

    Getting a texture out of ComfyUI as a proper .dds with the right BC format and a full mip chain used to mean exporting a PNG and opening an external texture tool. Save DDS Image removes that whole detour - it's the compression end of this pack's DDS pipeline, and it's the node you'll wire every game texture through.

    How it works

    It feeds your image tensors through the bundled DirectXTex texconv tooling, which does the actual BC block compression and mipmap generation. Saving is threaded, so a batch of textures writes in parallel rather than one file at a time.

    The output format dropdown is the whole ballgame. The pack's own guide is the shortest summary you'll find:

    | Format | Use it for | | --- | --- | | BC1_UNORM | Opaque textures, no alpha | | BC3_UNORM | Textures with alpha transparency | | BC4_UNORM | Grayscale (height maps) | | BC5_UNORM | Normal maps (RG channels) | | BC6H_UF16 | HDR textures, no alpha | | BC7_UNORM | Highest quality, biggest files |

    Default is BC3_UNORM - a reasonable all-rounder for anything with alpha.

    The inputs that matter

    Required: images, filename_prefix (files get numbered prefix_00001.dds, prefix_00002.dds…), format, and output_color_space. On color space: sRGB for albedo/diffuse, Linear for normal, height, and roughness maps - and the tooltip reminds you you can connect this straight from a DDS Loader's color_space output so you never guess wrong.

    The optional ones are where the power lives:

    • mipmap_levels (Full Chain default) and mipmap_filter (Box default) - leave on Full Chain/Box unless you know an engine wants a specific chain.
    • preserve_alpha_coverage - set ~0.5 for foliage/hair so alpha doesn't shrink as mipmaps downsample. 0 is off.
    • gpu_adapter - BC6/BC7 compression can run on the GPU; if your discrete card isn't adapter 0 (common on laptops with hybrid graphics), switch to GPU 1.
    • output_path - absolute path, or empty for the ComfyUI output folder.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/lilquail/ComfyUI-Leputen-Utils
    

    Restart ComfyUI, find it under Leputen-Utils → DDS. Windows ships texconv.dll in bin/; Linux/macOS need the libtexconv.* from Texconv-Custom-DLL releases placed there first.

    Troubleshooting

    • BC5 saves but won't load. Known issue in this pack - writing BC5 normal maps is fine, but trying to load a BC5 file back errors and needs a restart. Save normal maps as BC5 only if you don't need to re-import them.
    • DLL COM warnings (E_NOINTERFACE, RPC_E_CHANGED_MODE) - safe to ignore; the node falls back to a texconv.exe subprocess.
    • Wrong color on the saved texture - almost always the color space. An sRGB albedo saved as Linear looks washed; a Linear normal saved as sRGB looks wrong under lighting.
    • "Texconv not found" - verify bin/texconv.dll (or .exe) is present and has execute permissions.
    • Laptop GPU - if BC7 compression is mysteriously slow, set gpu_adapter to your discrete GPU.

    This is one of the two nodes (with Load DDS Image) that justify the whole pack. If your pipeline ends in "game-ready .dds", this is your exit ramp.

    CategoryLeputen-Utils/DDS

    Inputs (9)

    NameTypeDefaultDescription
    imagesIMAGEThe batch of image tensors to be saved as DDS files.
    filename_prefixSTRINGComfyUIA prefix for the output filenames. Each saved DDS file will be named 'prefix_00001.dds', 'prefix_00002.dds', etc.
    formatCOMBOBC3_UNORMThe compression format for the output DDS file. BC1 is best for opaque textures (no alpha). BC3 is ideal for textures with alpha transparency. BC7 offers the highest quality but larger file sizes. BC4/BC5 are for grayscale and normal maps.
    output_color_spaceCOMBOsRGBThe color space of the output file. sRGB for albedo/diffuse textures, Linear for normal maps, height maps, etc. Can connect from DDS loader.
    output_pathoptSTRINGOptional: Specify an absolute path for saving. If empty, saves to ComfyUI output directory.
    mipmap_levelsoptCOMBOFull ChainMipmap levels: 'Full Chain' = all, 'None' = disabled, or specify count.
    mipmap_filteroptCOMBOBoxMipmap filter. Box: fast default. Linear/Cubic: smoother. Triangle: good for alpha. Point: nearest.
    preserve_alpha_coverageoptFLOAT0.00–1Preserve alpha coverage during mipmapping. 0 = off. Use ~0.5 for foliage/hair.
    gpu_adapteroptCOMBOAuto (GPU 0)GPU for BC6/BC7 compression. Use 'GPU 1' if discrete GPU isn't adapter 0.

    Outputs (0)

    No outputs