package main // comfyFetchScript is added to the pages of ComfyUI that we serve. ComfyUI's own "Download" buttons make the browser fetch // a model file, which lands on the computer of the person who clicked; this script catches those downloads (a Hugging Face // model address) and sends them to the machine instead, which downloads the file into its models folder (the agent's // /_wxch/fetch, reached through the tunnel). A small button next to the logo opens a box for pasting an address by hand, // which also works when a ComfyUI version does its download in a way the script does not recognise. // // The text is plain ES5 so that it runs in any browser; there are no backticks in it (it is a Go raw string). const comfyFetchScript = ``