Nodes/comfyui-llamacpp-plus/LlamaCPP Visualizer HTML
ComfyUI Node

LlamaCPP Visualizer HTML

The tiny settings node that turns model output into a screenshot

By pointave·Created 6 months ago·Updated 3 months ago· 2
LlamaCPP Visualizer HTML
    • viz_settings
    width800
    height600
    js_delay_ms500

    LlamaCPP Visualizer HTML is a three-input settings node with a boring job: it packages render dimensions and hands them to LlamaCPP Chat. That's it. No HTML is generated here, nothing is rendered here. Its entire output is one LLAMACPP_VIZ_SETTINGS object you wire into the chat node's viz_settings input. But boring is fine when the alternative is hardcoded magic numbers, and this is the node that gives you control over the coolest trick in the pack.

    The trick: when the chat node runs in visualization=html mode, it tells the model to output a single complete HTML document - no markdown, no fences, just <!DOCTYPE html> to </html> - and then screenshots it. That's how you get a live chart, a dashboard, or a formatted table out of a local LLM and straight into an IMAGE tensor for the rest of your workflow. The rendering happens through Playwright driving headless Chromium; this node just sets the viewport.

    What you set

    • width - viewport width, 64–4096, default 800.
    • height - viewport height, 64–4096, default 600.
    • js_delay_ms - how long to wait after the page loads before the screenshot, 0–5000, default 500. This is the one beginners underestimate. If the model's HTML runs JavaScript (Chart.js from a CDN is the canonical case), the chart needs a beat to draw itself. Give it the 500ms default or bump it for heavier scripts; too little and you screenshot a blank canvas.

    That's the whole node. The defaults - 800x600, 500ms - are exactly what the chat node uses if you don't wire this at all, so this is pure optional polish. Right-click → Convert to Input if you want to drive the dimensions from another node, but for most people the widgets are fine.

    What it needs

    The rendering is done by Playwright, which the pack's requirements.txt declares but doesn't install a browser for. That's a manual step, and it's the one that bites:

    pip install playwright && playwright install chromium
    

    If you skip it, the chat node's html_image output comes back as a flat gray placeholder and the console logs something like playwright not installed. The chat node is also polite about degenerate inputs: if the model returns no HTML at all (say it answered in plain prose despite the instructions), you get the same gray placeholder rather than a crash.

    The honest take

    This is a genuinely thin node - you could argue it's just three numbers - but it's the difference between hardcoding a render size in the chat node and having it live in the graph where you can see it. It also exists as a hint about how the author thinks: render settings as a first-class node, not buried widgets. If you're only here for text chat, ignore it. If you want the model to draw you a chart, it's your control panel.

    CategoryLlamaCPP API

    Inputs (3)

    NameTypeDefaultDescription
    widthINT80064–4096
    heightINT60064–4096
    js_delay_msINT5000–5000ms to wait for JS to execute before screenshot

    Outputs (1)

    NameTypeDescription
    viz_settingsLLAMACPP_VIZ_SETTINGS