Nodes/ComfyUI_LiteLLM/HTMLRendererScreenshot
ComfyUI Node

HTMLRendererScreenshot

Rendered HTML that comes back as an actual image in your pipeline

By Hopping-Mad-Games·Created 2 years ago·Updated 11 months ago· 7
HTMLRendererScreenshot
    • IMAGE
    • STRING
    html_content<h2>Hello World!</h2>
    screenshot_base64

    The other HTML nodes turn HTML into a preview or a URL. HTMLRendererScreenshot is the one that closes the loop back into pixels: it renders the HTML and returns an actual ComfyUI IMAGE tensor, so the page an LLM generated can flow into the image side of your graph - saved with SaveImage, upscaled, compared, or fed into an image model.

    It's the weirdest of the three HTML nodes, because the screenshot part doesn't happen in the node itself. The node is a converter: it takes HTML plus a base64-encoded screenshot, decodes the screenshot into an IMAGE tensor, and passes the HTML through as a string. The screenshot itself has to come from somewhere - this pack's design leans on a browser-side capture (the code references html2canvas), but whatever produces the base64 image, the node's job is the same: base64 in, tensor out.

    How it works

    If screenshot_base64 is empty, the node doesn't fail - it returns a 1×1 black placeholder image and a "no image" UI message. That's deliberate: it keeps the workflow runnable while you're wiring things up. When you supply real base64, it decodes, converts to RGB, normalizes to float [0,1], and returns a (1, H, W, 3) tensor - the standard ComfyUI IMAGE shape. The HTML string rides along as a second output so you don't lose the source.

    The inputs and outputs

    • html_content (multiline, default <h2>Hello World!</h2>) - the HTML being rendered/captured.
    • screenshot_base64 (STRING, default empty) - the base64 JPEG/PNG of the rendered page.
    • Outputs: IMAGE - the decoded screenshot as a tensor, and STRING - the HTML content passed through.

    It's an output node, so the image also shows in the UI on execution.

    Installing

    Ships with ComfyUI_LiteLLM. ComfyUI Manager, search "ComfyUI_LiteLLM", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Hopping-Mad-Games/ComfyUI_LiteLLM
    cd ComfyUI_LiteLLM
    pip install -r requirements.txt
    

    Restart, find it under ETK/LLM/LiteLLM. No API keys.

    Where people get burned

    The #1 confusion is expecting this node to take the screenshot itself. It doesn't - there's no headless browser inside it. If you wire it up with no screenshot_base64, you'll get a 1×1 black image and wonder why nothing rendered. You need a capture source: this pack assumes a frontend capture step, or you can generate the screenshot any way you like (Puppeteer, a Playwright script, a service) and feed the base64 in. Second, the base64 must be a decodable image - passing arbitrary text gets you a decode error. And because this node returns a real tensor, mind the shape expectations downstream: it's a single-image batch, so batch-aware nodes will treat it as one image. If your goal is just "see the HTML," the plain HTMLRenderer is the simpler tool; this one is for when the rendered page needs to become part of the image workflow.

    CategoryETK/LLM/LiteLLM

    Inputs (2)

    NameTypeDefaultDescription
    html_contentSTRING<h2>Hello World!</h2>
    screenshot_base64STRING

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    STRINGSTRING