ComfyUI Node

Load DDS File

DDS textures in ComfyUI, without the round-trip through a converter

By maikgreubel·Created 11 months ago·Updated 11 months ago· 0
Load DDS File
    • IMAGE
    image

    DDS (DirectDraw Surface) is the texture container of the DirectX world - the format games and engines actually store their assets in. Unreal, Godot, Skyrim mods, the whole block-compressed BCn/DXT family: that's DDS territory. And ComfyUI's built-in Load Image won't touch it. It reads PNG, JPEG, WebP, GIF, BMP, SVG, TIFF - no DDS.

    So if your work involves game assets - upscaling a texture pack, inpainting a seam out of a skin, AI-texturing a 3D model - you've been stuck doing the dance: convert every DDS to PNG in an external tool, feed that in, generate, convert back. Every single iteration. Load DDS File (from the maikgreubel/comfyui-loaddds pack) collapses that loop into one node. It's a tiny, single-purpose bridge: pick a .dds from your input folder and out comes a perfectly ordinary IMAGE tensor, the same thing every other ComfyUI loader hands you.

    How it works

    Under the hood it's mostly borrowed muscle. The node hands the file to Wand, the ImageMagick Python binding, and ImageMagick is what actually decodes those block-compressed formats - BC1 through BC7/DXT, compressed or uncompressed. Once decoded, the node forces an RGBA layout, divides every pixel value by 255 to land in the [0, 1] float range, and returns a torch.Tensor shaped [1, H, W, C] (batch, height, width, channels).

    Two details in the source are worth knowing. First, it validates that the file really is a DDS before processing, and it guards the path against directory traversal - small pack, but it's not sloppy. Second, the alpha handling is conditional: if the alpha channel is fully opaque or fully transparent, it strips it and you get 3-channel RGB; only partially-transparent textures keep 4 channels. That's a real gotcha, more below.

    The inputs and outputs that matter

    There's exactly one input, image: a dropdown listing the .dds files in your ComfyUI input folder. You can also drag a file onto it to upload, same as the stock loader.

    One output, IMAGE, shape [1, H, W, C] with float values 0–1. Wire it anywhere a Load Image output plugs in: into an upscaler, a VAE encode, a ControlNet preprocessor, an inpaint mask pipeline - nothing downstream knows or cares that the pixels started as a game texture.

    Installing it

    The README documents the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/maikgreubel/comfyui-loaddds.git
    

    Then restart ComfyUI. You can also try ComfyUI Manager (search "Load DDS File") - though this is an obscure pack with near-zero community footprint, so if Manager can't find it, the git clone above is the reliable path.

    Here's the part the README forgets, and where people get burned: the pack ships no requirements.txt. Nothing auto-installs Wand for you. If you don't have it, the node errors out the moment ComfyUI imports it. So plan on two manual steps:

    pip install Wand            # the Python binding
    # then ImageMagick itself - on Debian/Ubuntu:
    sudo apt install imagemagick
    

    On Windows, install ImageMagick from the official installer and make sure it's on your PATH; on macOS, brew install imagemagick. ComfyUI already brings numpy and torch, so those are covered.

    Common issues

    • No module named 'wand' on startup - the missing requirement above. Install Wand and ImageMagick, restart.
    • Failed to load DDS file at runtime - ImageMagick couldn't decode that particular variant. Exotic DX10 textures (BC7, volume textures, weird mip setups) are the usual suspects; convert those to a plain DDS or PNG outside ComfyUI.
    • A downstream node chokes on 4-channel input - remember the alpha logic. A partially-transparent DDS keeps RGBA, but a lot of ComfyUI nodes quietly expect 3-channel RGB. If your results look wrong and your texture has partial transparency, that's why; flatten the alpha first.

    The honest verdict

    This is a niche utility, and for a one-off job magick convert is genuinely faster than adding a node. But if you iterate on game textures inside ComfyUI - and you pair it with a DDS save node on the way out, which the author points to as the companion piece - it turns a clunky convert-every-time workflow into something that just stays in the graph. That's worth the ImageMagick install.

    Categoryimage

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO0 options:

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE