Nodes/ASTERR/Save ASTERR Script
ComfyUI Node

Save ASTERR Script

The Save Button for Your ASTERR Scripts — Then They Show Up in the Dropdown

By WASasquatch·Created 3 years ago·Updated 2 years ago· 29
Save ASTERR Script
    • script_string
    script_string
    script_name
    overwrite_script

    SaveASTERR is the little companion node in the WASasquatch/ASTERR pack, and it exists to close a loop. The main ASTERR Script node lets you run a Python script inline or pick one from its preset_script dropdown - but that dropdown only lists .py files sitting in the pack's scripts/ folder. This node is how files get there without you touching a file manager. You feed it a script as a string, give it a name, and it writes the file to disk.

    Mechanically it's dead simple: script_string gets written to ASTERR/scripts/<script_name>.py, plain text, UTF-8. The overwrite_script toggle (false/true) controls whether it will clobber an existing file with the same name - leave it false and it quietly refuses, protecting scripts you've already got. The single script_string output just passes your input straight through, which is handy if you want to save a copy of a script while still feeding the text somewhere else in the graph. That's the whole thing.

    The three inputs to know:

    • script_string - the Python source you want saved. It's forceInput, so you typically wire it from a text node or from the script output of another node rather than typing into the widget.
    • script_name - the filename without the .py extension.
    • overwrite_script - false means "don't touch what's already there", true means "replace it".

    It pairs naturally with the ASTERR Script node: build your script, save it here, then swap the ASTERR node's preset_script dropdown to your new file and you've got a reusable, versioned utility. Since the saved files are ordinary .py, you can also open and edit them in any code editor between saves.

    Two gotchas worth knowing. First, an empty script_string or empty script_name doesn't error - it just prints a warning to the console and writes nothing, which is easy to miss mid-workflow, so check the name field before you hit run. Second, an already-placed ASTERR Script node reads the script list when it's created, so a freshly saved script may not appear in its dropdown until you add a new ASTERR node or reload the workflow.

    Installation is the same as the parent pack, since this node ships inside it - Manager (search "ASTERR") or cd ComfyUI/custom_nodes && git clone https://github.com/WASasquatch/ASTERR, then restart. No models, no extra dependencies. Same security caveat applies by association: you're writing runnable Python onto a disk that a web-facing ComfyUI instance can execute, so this belongs in a closed-off environment, not a box you've exposed to the internet.

    Category_for_testing

    Inputs (3)

    NameTypeDefaultDescription
    script_stringSTRING
    script_nameSTRING
    overwrite_scriptCOMBO2 options: false, true

    Outputs (1)

    NameTypeDescription
    script_stringSTRING