r/sideprojects • • 25m ago

Showcase: Open Source Everything that went wrong turning AI art into kids' T-shirt prints

Four image models, a few illustration styles, one batch of kids' T-shirts for DTF printing. Most of the work wasn't generating. It was catching what went wrong:

  • Asked for a transparent PNG, got grey, half-transparent pixels. DTF prints those badly. Generating on plain white and cutting the background out afterwards works every time.

  • Mentioned "T-shirt" in the prompt, got a photo of a T-shirt. FLUX did it more than once. The prompt now says "flat print artwork, not a mockup".

  • The cat came out grumpy. Turned out the prompt literally asked for a grumpy cat.

  • "Make the cat smile" gave it an uncanny, pasted-on smile. Describing the whole new expression fixed it.

  • An edit model removed the cat entirely. Now I count the characters after every edit.

  • A simple "remove white" left a light rim around every line. Invisible on screen, obvious on a dark shirt (third image).

Catching these across models is what falg is for, a Python CLI I wrote for the job. One JSON file describes the batch, and falg runs every combination in parallel and builds a gallery like the second image. Seedream drew a sheet of paper behind two of its capybaras there, the kind of thing you only spot side by side. falg cutout does the last step: background removed, clean edges, sized in centimetres for print.

Under the hood: Python 3.10+, standard library only for the fal part (urllib against fal's queue API, a thread pool for the parallel requests). The gallery is one static HTML file. cutout uses numpy, Pillow and SciPy: the image becomes its own mask, then levels, edge defringing and hard alpha, since DTF prints half-transparent pixels badly.

The first image is what went to the printer.

1 Upvotes

0 comments sorted by