Nodes/ComfyUI-color-ascii-art-node/ASCII Text Layout Planner
ComfyUI Node

ASCII Text Layout Planner

The boring node that saves you from wasted ASCII renders

By Shiba-2-shiba·Created 2 years ago·Updated 6 months ago· 7
ASCII Text Layout Planner
    • IMAGE
    image
    pixel_size20
    aspect_ratio_correction0.75
    resolution_scale4.0
    font_name
    font_size12

    ASCIITextLayoutPlanner is the least flashy node in the comfyui-color-ascii-art-node pack, and it might be the most useful one if you're working with the novel-text renderer. Its whole job is to answer three questions before you commit to a render: how big is the character grid, how many characters will it need, and what resolution will the output be? You drop in an image, set your grid parameters, and the node does the math live - no waiting on a render to discover your 2,000-word text file doesn't cover a 40×70 grid.

    How it works

    It's a planner, not a renderer. The node loads your image, validates the grid math, and passes the image straight through as its IMAGE output so you have something to preview. The real work happens in its custom front-end: as you drag pixel_size, aspect_ratio_correction, and resolution_scale, the node's UI computes and displays info widgets for the grid dimensions, required character count, and final render size right on the node - then updates as you change parameters.

    The math is the same as the renderer uses, which is the whole point of using it:

    grid_width  = image_width  // pixel_size
    grid_height = image_height / (pixel_size * aspect_ratio_correction)
    required_chars = grid_width * grid_height
    render_width  = image_width  * resolution_scale
    render_height = image_height * resolution_scale
    

    Characters are taller than they are wide, so aspect_ratio_correction (0.75) shrinks the effective cell height - skip it and your grid comes out wrong-shaped, and the planner is where you'll see that before the renderer burns CPU on it.

    Inputs

    Only six, and they mirror the ones the renderer needs:

    • image - a file picker with a drag-and-drop upload, working like the core Load Image node rather than taking a tensor wire.
    • pixel_size (default 20), aspect_ratio_correction (0.75), resolution_scale (4) - the grid and output-size trio.
    • font_name and font_size - so the estimate matches what ASCIINovelTextArt will actually draw.

    Output is a single IMAGE (your input, for preview). The numeric info lives in the node's own widgets.

    Installing it

    Same one-pack install as the rest:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Shiba-2-shiba/comfyui-color-ascii-art-node.git
    cd comfyui-color-ascii-art-node
    pip install -r requirements.txt
    

    Restart ComfyUI afterward. No model files, no extra downloads - the dependencies are just Pillow, colorama, and color-matcher, and Pillow ships with ComfyUI anyway. ComfyUI Manager users can search "ComfyUI-color-ascii-art-node" instead of cloning.

    Using it in practice

    Build the workflow the author intends: Load Image (or this planner's own picker) → ASCIITextLayoutPlanner → ASCIINovelTextArt → Save Image. Use the planner's widget numbers to sanity-check your text file against the grid (required_chars vs. the file's length) and to confirm the output size you're committing to. If required_chars dwarfs your text and text_shortage_mode isn't set to loop, you'll get a short, truncated render - catch it here, bump pixel_size, or shorten the file, and only then run the real render. It's the classic "measure twice, cut once" node, and in a pack this fiddly you'll be glad it's there.

    One small thing to know: because the pack is built on ComfyUI's newer comfy_api extension API, it needs a reasonably recent ComfyUI. If the nodes don't appear after install, update ComfyUI before hunting for deeper problems.

    CategoryImage Processing/ASCII Art

    Inputs (6)

    NameTypeDefaultDescription
    imageCOMBODrag and drop an image file, like the core Load Image node.
    pixel_sizeINT201–200
    aspect_ratio_correctionFLOAT0.750.1–10
    resolution_scaleFLOAT4.01–16
    font_nameCOMBO9 options: Chewy-Regular.ttf, Creepster-Regular.ttf, Customfont.ttf, KR Rachel's Chalkboard.ttf, Lobster Bisque.ttf, NotoSansJP-VariableFont_wght.ttf, +3
    font_sizeINT121–300

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE