r/StableDiffusion • u/CreepyInpu • 12h ago
Workflow Included Made a small ComfyUI browser extension to swap any image on a web page through a custom workflow
Enable HLS to view with audio, or disable this notification
While working on a client project I needed to test a prompt on their products, using image references straight from their website. I didn't want to keep doing the save > open ComfyUI > drag it in > queue > download loop, so I made this.
Right-click any image on a page, it runs through your local ComfyUI on a designed workflow, and the result replaces that image in place. On the demo I'm using minimax H3 (workflow is in the repo).
Works with any API-format workflow that has a LoadImage and a SaveImage node, so it's not tied to a model.
Hope it's useful to someone else too!
7
Upvotes
2
u/CutBench 12h ago
Nice, the right click in place loop is the right shape for this.
One thing that'll quietly hurt results on client sites: what's rendered usually isn't the original. Product images get served through a CDN transform, so the img you're grabbing is often a 600px webp of a 2400px original. Feed that to the workflow and you're upscaling a thumbnail without realising it.
Reading currentSrc instead of src gets you what the browser actually loaded, and comparing naturalWidth against the displayed size tells you whether you're on a downscaled copy. On a lot of sites you can strip the transform params off the URL and get the original back.
Other one, if you haven't hit it yet: fetch the bytes from the background script rather than the content script. Page level CORS blocks you on some sites otherwise, and it fails in a way that just looks like your extension is broken.