Fooocus Colab: run the official notebook step by step
Fooocus Colab means the official notebook in the Fooocus GitHub repository: open it, run its one cell on a GPU runtime and open the public link it prints. On the free T4 the refiner is off and big features such as Image Prompt can drop the session. If you would rather skip the setup, the studio below works the same way in your browser. Fooocus.app is an independent site on other image models, not Fooocus itself.
Last updated:
No notebook needed: the same prompt, styles and Speed or Quality flow, on Nano Banana 2.1 and GPT Image 2.
The free credits cover one Nano Banana 2.1 image (25 credits). No watermark.
Open Tools on any image to vary, upscale, inpaint, outpaint, use it as an image prompt or describe it. A re-run with the same settings makes a new take, not the identical image.
How to run Fooocus on Google Colab
- 01
Open the official notebook
Use the Colab badge in the Fooocus readme, which opens colab.research.google.com/github/lllyasviel/Fooocus/blob/main/fooocus_colab.ipynb. Other notebooks exist (camenduru's template is the one the official one credits), but start from the official one.
- 02
Pick a GPU runtime
In Colab, open Runtime → Change runtime type and choose a T4 GPU. On a CPU runtime the cell runs, but images take far too long.
- 03
Run the cell and wait for the models
The cell clones Fooocus, installs it and downloads the default SDXL model on the first run, which takes several minutes. It ends by starting the app with the --share and --always-high-vram flags.
- 04
Open the public link
When the log prints a gradio.live address, open it in a new tab. That page is the Fooocus interface, running on your Colab GPU for as long as the session lasts.
- 05
Switch presets with a flag
For the anime or realistic edition, add --preset anime or --preset realistic to the last line and run the cell again, rather than switching presets inside the interface.
What the official Fooocus Colab notebook runs
The notebook runs the real Fooocus software on a Colab GPU. You get the same interface, styles and SDXL models as a local install, with nothing on your own computer.
Its last line starts the app. The --share flag gives you the public link, and --always-high-vram moves memory from system RAM to the GPU, which suits the T4. The readme lists it as last tested on 12 August 2024.
!python entry_with_update.py --share --always-high-vramFree Colab limits you will run into
On free Colab, expect a smaller feature set and sessions that end: the readme turns the refiner off by default and warns that heavier features can disconnect the free tier.
- The refiner is off in the notebook, because free Colab resources are limited.
- Image Prompt and other "big" features may disconnect a free session; plain text-to-image is the part kept working.
- Switching presets in the interface can time out after 60 seconds. Wait for the model download to finish, then reload the page.
- Models download again in every new session, and images stay in the session unless you save them to Google Drive.
- Colab ends idle sessions and limits free GPU time, so a long run can stop part way.
Fixes for the usual Colab errors
Most Colab failures come from the runtime type, the session ending or a preset switch mid-download; each has a quick fix.
- No gradio.live link: check the runtime is a GPU, then run the cell again from the top.
- The link stops loading: the session has ended. Run the cell again; a new link is printed each time.
- A timeout after changing presets: let the download finish, reload the page, or restart with the --preset flag.
- Disconnects with Image Prompt on: keep to text-to-image on the free tier, or use a paid Colab plan.
Colab, a local install or the browser: which fits
Colab suits you if you want the real Fooocus without a GPU and can live with sessions. A local install suits a capable Nvidia card, and the browser studio suits you if you want no setup at all.
| Fooocus on Colab | Fooocus installed locally | Fooocus.app | |
|---|---|---|---|
| Setup | Run one notebook cell each session | Download, unzip, first run downloads models | Sign in |
| Hardware | Colab GPU (T4 on the free tier) | Nvidia GPU with 4 GB VRAM and 8 GB RAM or more | Any browser, phone included |
| Models | SDXL checkpoints (Juggernaut XL by default) | SDXL checkpoints (Juggernaut XL by default) | Nano Banana 2.1 (Speed) and GPT Image 2 (Quality) |
| Controls | Full Fooocus controls; refiner off by default | Full Fooocus controls: seed, sampler, LoRAs, refiner | Speed or Quality, styles, Vary, Upscale, Inpaint, Outpaint, Image Prompt, Describe |
| Cost | Free tier, or a paid Colab plan | Free (your own hardware and power) | 25 credits a Speed image, 61 a Quality image |
| Your images | Gone when the session ends, unless saved to Drive | In the outputs folder on your disk | Kept in your account for 30 days |
Plans start at $7.69 a month or $76.95 a year; the Big Batch pack is $31.55 once, and its credits never expire.
Questions
Is Fooocus on Colab free?
Yes, the notebook and Fooocus are free; Colab’s free tier gives limited GPU time, and paid Colab plans give more. The notebook itself costs nothing.
Why does Fooocus keep disconnecting on Colab?
Usually the free tier’s limits: the readme warns that Image Prompt and other heavy features can disconnect free Colab. Stick to text-to-image there, or use a paid plan.
Can I use the anime or realistic preset on Colab?
Yes. Add --preset anime or --preset realistic to the notebook’s last line and run it again; switching presets in the interface can time out.
Is Fooocus.app the Colab notebook?
No. Fooocus.app is an independent browser studio inspired by Fooocus’s simple workflow. It does not run Fooocus; images are made with Nano Banana 2.1 and GPT Image 2.
Do I need a Google account for the Fooocus Colab?
Yes, Colab needs a Google account. Fooocus.app needs only its own sign-in, and new accounts get 25 free credits, enough for one Speed image.