ComfyUI Node

DXF Import

Bring real CAD files into your ComfyUI graph

By orion4d·Created about a year ago·Updated 12 months ago· 11
DXF Import
    • DXF
    file_pathC:/path/to/your/file.dxf

    Everything else in the DAO pack's DXF section builds geometry from scratch. DXF Import is the node that lets you start from something real - a .dxf file exported from actual CAD software, a plotter design, a shop drawing you've had lying around. It loads the file into the pack's DXF object type, and from there it's a first-class citizen: add primitives, transform it, preview it, or convert it to SVG.

    It's part of orion4d/ComfyUI_DAO_master, the French-authored vector-and-image pack. Under the hood it's ezdxf.readfile(), the same mature library that powers the whole DXF family, so you're not parsing anything by hand - files load with real CAD entity support.

    How it works

    One input, one output:

    • file_path - a string path to the .dxf file. The default is the not-subtle placeholder C:/path/to/your/file.dxf.
    • Output: a DXF object holding the loaded document.

    On load it reads the modelspace and reports how many entities it found in the log. Because the file doesn't carry a reliable unit declaration, the node tags it unitless - you'll want to keep that in mind if dimensions matter downstream.

    What to do with it

    This is the natural entry point to the vector pipeline: load an existing drawing, add a few primitives, then either render it to an image with DXF Preview or push it through DXF to SVG to get SVG geometry for the pack's SVG nodes. It's also the honest answer to "can ComfyUI touch my CAD files" - yes, read them, extend them, and preview them.

    Installing

    ComfyUI Manager (search ComfyUI_DAO_master) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/orion4d/ComfyUI_DAO_master.git
    pip install ezdxf
    

    Restart, and you're importing.

    Where people get burned

    The error handling is blunt but clear: a missing file raises FileNotFoundError (message literally says "Fichier DXF non trouvé" - the pack's messages are French), and an unreadable file raises an IOError naming the parse problem. Path escaping is the other classic: on Windows, use forward slashes (C:/drawings/part.dxf) in the string field. And don't be surprised when previews treat the drawing as unitless - the pack doesn't know your file was in millimeters, so scale and rotate with DXF Transform to match whatever you're building.

    CategoryDAO_master/DXF/IO

    Inputs (1)

    NameTypeDefaultDescription
    file_pathSTRINGC:/path/to/your/file.dxf

    Outputs (1)

    NameTypeDescription
    DXFDXF