LightPhotos

ComfyUI for local AI

I promised never to send your photos to a cloud AI. Generative fill still sounded useful. ComfyUI lets me have both: the model runs on your own computer, next to your photos.

Why ComfyUI

In my plan, I said no to cloud AI and maybe to ComfyUI. Cloud AI sends your photo to servers that another company controls. I won’t do that.

Building image generation into LightPhotos would be worse in a different way. The app would grow by gigabytes, I would have to keep GPU code working on four platforms, and you would be stuck with my choice of model.

ComfyUI already does the hard part. It runs image models on Mac, Windows and Linux, on whatever GPU you have, and it is free and open source. It has an HTTP API on your own computer. So LightPhotos generates nothing itself. It sends the area you painted to ComfyUI and keeps what comes back.

Setting it up

  1. Install ComfyUI Desktop and start it. A ComfyUI that you run from source works too.
  2. In LightPhotos, open Settings and turn on Enable ComfyUI. It is off by default. While it is off, LightPhotos never contacts a server.
  3. Leave Server empty. LightPhotos tries ComfyUI Desktop’s port, 8000, and then 8188, on 127.0.0.1.
  4. Check Models folder. LightPhotos reads the folder that ComfyUI Desktop is set to, so it is usually filled in already.
  5. Under Generative Fill, click Download for each model file.

LightPhotos ships no model weights. Generative Fill uses SDXL Inpainting 0.1, as four files from Hugging Face: the UNet, two text encoders and the VAE, 6.9 GB together. Each one downloads to a .part file and is renamed into place only when its size and SHA-256 match, so ComfyUI never sees half a model. If the download stops, it continues where it stopped.

Using it

Open a photo, go to Touch Up and click + Brush. Paint over what you want gone and let go. That’s it.

When something is missing, the button is greyed out, not hidden, and its hover text names the first thing to fix: turn it on in Settings, choose the models folder, download a file, or start ComfyUI. When ComfyUI starts, the button turns on by itself within five seconds.

A fill is just another edit

This is the part that took the most work, and the part I care about most. A generated patch isn’t pasted into your photo:

What LightPhotos sends

Only a crop. LightPhotos cuts out the painted area with some space around it, scales it to 1024 pixels or less, and sends that, with the painted part made transparent. ComfyUI never gets the whole photo, the file name or the metadata. ComfyUI keeps the crops it receives in its own input folder, so empty that folder if you don’t want them kept.

LightPhotos asks the server only while Touch Up is open, every five seconds while it is down and every 30 seconds while it is up. If ComfyUI stops halfway, the error says what to do: “ComfyUI stopped responding at 127.0.0.1:8000. Start it again, then press Generate.” A generation that gets one or two variations keeps them.

The limits

What’s next

Generative Fill is the first row in a table of AI features. Each row is a workflow and the model files it needs. Settings, the downloads and the server check all read the table, so the next feature is mostly a new workflow, not new plumbing.

The rule stays the same: AI in LightPhotos runs on your computer, or not at all.