Nodes/ComfyUI-Html2Image/🐟Webpage Screenshot
ComfyUI Node

🐟Webpage Screenshot

Point real headless Chrome at any URL and get back a ComfyUI IMAGE

By liuqianhonga·Created 2 years ago·Updated about a year ago· 16
🐟Webpage Screenshot
    • IMAGE
    urlhttps://example.com
    width1280
    height720
    wait_time_seconds0.50
    full_pagefalse
    css_selector

    This node is exactly what its name says: it drives a real headless Chrome to a URL, screenshots it, and hands you the result as a standard ComfyUI IMAGE. At 3 impressions it's basically undiscovered, which is a shame, because "grab actual web content as an image" is one of those things that's fiddly to do any other way in ComfyUI.

    Where it earns its keep: you want a real-world reference image to img2img against, you want to screenshot your own dashboard or a page you're designing to feed into a vision model, or you want to turn a live web page into a controlnet-friendly input. It also pairs naturally with the rest of this pack - same browser machinery that renders the HTML templates, pointed at the internet instead.

    How it works

    It's the pack's shared Selenium base doing the work. Chrome opens a window at your width and height, then the node waits for the page's document.readyState to hit "complete" and for every image to finish loading, plus your extra wait_time_seconds on top. Then it either grabs the whole viewport, expands to the full page, or zooms in on a single element and screenshots that.

    The inputs that matter

    • url - what to shoot. Defaults to https://example.com; put your real target here.
    • width / height - viewport size, 64–4096 (default 1280×720).
    • wait_time_seconds - extra settle time before the shot. Default 0.5; bump it for slow or JS-heavy pages.
    • full_page - boolean. When on, it scrolls to the full document height and ignores height. Great for long articles, but pages with sticky/fixed headers will show the same element repeated.
    • css_selector - optional. Give it something like .content or #main-header and it captures just that element instead of the whole page. Useful for grabbing one chart or one card out of a cluttered layout.

    Outputs

    A single IMAGE output. That's it - wire it into a Save Image, an img2img sampler, or a vision-model node.

    Installing

    ComfyUI Manager → search "ComfyUI-Html2Image". Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/liuqianhonga/ComfyUI-Html2Image.git
    pip install -r requirements.txt
    

    Then restart. Dependencies are selenium, webdriver_manager, jinja2, Pillow. The silent requirement: Google Chrome must be installed - Selenium launches a real Chrome binary; webdriver_manager only auto-downloads the matching chromedriver, not the browser itself. On a machine without Chrome this node dies instantly with a "no such binary" style error, and the README won't warn you.

    Troubleshooting

    • Blank or partial screenshot - the site probably needs login, blocks bots, or loads content after your wait time. The README's own FAQ points at exactly this. Increase wait_time_seconds first; accept that login-gated pages will just come back blank.
    • Selector not found - the node raises a clear error for that. Usually the element is rendered dynamically after load, so bump the wait time rather than second-guessing your selector syntax.
    • Full-page capture looks broken - fixed-position elements are the usual culprit; the page height calculation also goes sideways on infinite-scroll sites.
    • First run is slow - chromedriver downloads once, needs internet.

    For a node nobody's talking about, this one is refreshingly honest about what it does. Just remember it renders pages in a real browser, so treat it like a browser: no login, no bot protection, no infinite scroll.

    Categoryimage

    Inputs (6)

    NameTypeDefaultDescription
    urlSTRINGhttps://example.com
    widthINT128064–4096
    heightINT72064–4096
    wait_time_secondsFLOAT0.50
    full_pageBOOLEANfalse
    css_selectoroptSTRING

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE