<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Bikram Pun</title>
    <description>The latest articles on DEV Community by Bikram Pun (@bikrampun).</description>
    <link>https://dev.to/bikrampun</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F943546%2F1ebcd183-63a4-4616-a333-56f1485c8e03.jpeg</url>
      <title>DEV Community: Bikram Pun</title>
      <link>https://dev.to/bikrampun</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bikrampun"/>
    <language>en</language>
    <item>
      <title>I let a laptop draw and check 16 images by itself. Gemma agreed with me 64% of the time.</title>
      <dc:creator>Bikram Pun</dc:creator>
      <pubDate>Sun, 25 Oct 2026 17:03:26 +0000</pubDate>
      <link>https://dev.to/bikrampun/i-let-a-laptop-draw-and-check-16-images-by-itself-gemma-agreed-with-me-64-of-the-time-1dan</link>
      <guid>https://dev.to/bikrampun/i-let-a-laptop-draw-and-check-16-images-by-itself-gemma-agreed-with-me-64-of-the-time-1dan</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week3-2026-10-19"&gt;Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Shotfill&lt;/strong&gt; takes a shot list and gives back every image, checked.&lt;/p&gt;

&lt;p&gt;You write one line per image:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;01 | A small red fox wearing a blue scarf reading a big book under an oak tree, not cartoon, no text on the book
02 | A cosy village bakery at dawn with bread in the window, no people, no signs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Then you start it and walk away. Shotfill draws every shot on your own laptop with open models, looks at each result, redraws the ones that miss, and leaves a short list of the shots it could not get right. In the morning you review that list instead of every image.&lt;/p&gt;

&lt;p&gt;The person who gets to be lazier is anyone who needs a few dozen matching images rather than one great one: scenes for a narrated video, pages of a picture book, a shop's product photos, course illustrations. I wrote it for the first of those. I make narrated videos, and generating one image at a time in a chat window, checking it, and trying again is the part I dread.&lt;/p&gt;

&lt;p&gt;It runs on an Intel laptop (i7-1165G7, 16 GB, Iris Xe, no NVIDIA GPU), offline, and costs nothing per image. SDXL draws by default. Z-Image Turbo is an optional backend.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;One command, two storybook shots, drawn with Z-Image Turbo. This is the real output from my laptop, sped up: the run took 8 minutes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn6he9tytn2v9ynb8trpb.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn6he9tytn2v9ynb8trpb.gif" alt="Terminal run of Shotfill on two storybook shots" width="720" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What comes out of the two examples in the repo. Top row: three storybook shots drawn with Z-Image Turbo, all images I labelled &lt;code&gt;use&lt;/code&gt; (Gemma failed the bakery one for readable text, but I would still use it). Bottom row: three catalogue shots drawn with the default SDXL backend.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F70jb6d68yzvgjh97m6zz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F70jb6d68yzvgjh97m6zz.png" alt="Painted storybook scenes above bakery product photos" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  A bigger test: 16 shots
&lt;/h3&gt;

&lt;p&gt;I also ran it on a 16-shot list for a narrated video, drawn with SDXL and checked by Gemma 4. Same prompts, three runs, as the code changed:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Run&lt;/th&gt;
&lt;th&gt;Passed&lt;/th&gt;
&lt;th&gt;Needs review&lt;/th&gt;
&lt;th&gt;Wall time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;First version (Oct 21)&lt;/td&gt;
&lt;td&gt;5 / 16&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;96 min&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Before my last prompt change&lt;/td&gt;
&lt;td&gt;13 / 16&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;about 50 min&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Current code&lt;/td&gt;
&lt;td&gt;12 / 16&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;70 min&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The code and the checks changed between runs, so this is a log of me fixing things, not a controlled benchmark. I didn't test whether the 12 vs 13 difference is real. Drawing took 72 s per image in the 50-minute run and 153 s in the 70-minute one. I haven't worked out why.&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/bikrampun" rel="noopener noreferrer"&gt;
        bikrampun
      &lt;/a&gt; / &lt;a href="https://github.com/bikrampun/shotfill" rel="noopener noreferrer"&gt;
        shotfill
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Hand it a shot list, get back every image, checked. Open models (SDXL + Gemma 4) draw and check a whole batch of images overnight on an ordinary laptop.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Shotfill&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;Hand it a shot list, get back every image, checked.&lt;/p&gt;

&lt;p&gt;You write one line per image. Shotfill draws them all on your own laptop overnight with open models, looks at each result, redraws the ones that miss, and leaves you a short list to review in the morning.&lt;/p&gt;

&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;01 | A small red fox wearing a blue scarf reading a big book under an oak tree, not cartoon, no text on the book
02 | A cosy village bakery at dawn with bread in the window, no people, no signs
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It's for anyone who needs a few dozen matching images rather than one masterpiece: scenes for a narrated YouTube video, pages of a picture book, a shop's product photos, cover images for a blog, illustrations for a course.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/bikrampun/shotfill/images/terminal-demo.gif"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fbikrampun%2Fshotfill%2FHEAD%2Fimages%2Fterminal-demo.gif" alt="Terminal run of Shotfill on two storybook shots with Z-Image Turbo"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That run is sped up: the real one took 8 minutes. It used the optional Z-Image backend (&lt;code&gt;--backend zimage&lt;/code&gt;…&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/bikrampun/shotfill" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;Repo: &lt;a href="https://github.com/bikrampun/shotfill" rel="noopener noreferrer"&gt;https://github.com/bikrampun/shotfill&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;MIT licensed. &lt;code&gt;python test_shotfill.py&lt;/code&gt; runs the logic checks without any model and prints &lt;code&gt;ok&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;A few open models and one small Python file.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Gemma 4 (via Ollama) rewrites each prompt.&lt;/strong&gt; Prompts written for chat image tools say things like "not cartoon". Stable Diffusion's text encoder reads keywords, not grammar, so "not cartoon" draws a cartoon. Gemma turns each prompt into positive scene words, a list of things to avoid (sent as the negative prompt), and one to three yes/no questions about what should be visible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SDXL draws it&lt;/strong&gt; (int8, converted for Intel chips) through OpenVINO on the laptop GPU. With &lt;code&gt;--backend zimage&lt;/code&gt; it uses Z-Image Turbo through stable-diffusion.cpp instead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemma looks at the image&lt;/strong&gt; and answers the questions: is it painted, is there readable text, is the fox there. &lt;strong&gt;Python decides pass or fail, not the model.&lt;/strong&gt; If the check call errors, the image fails.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Misses are redrawn&lt;/strong&gt; with a new seed, up to three attempts, with whatever was missing moved to the front of the prompt. A new seed alone rarely brought back a missing object.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frg4o2lxh22lbe0vf0klx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frg4o2lxh22lbe0vf0klx.png" alt="Diagram of the Shotfill loop from shot list to checked images" width="799" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SDXL (about 9 GB) and Gemma (about 7 GB) don't fit in 16 GB together, so it works in rounds: draw everything pending, free SDXL, check everything, unload Gemma, then redraw the misses. Progress is saved after every image. When an Ollama update restarted the server mid-run and killed my first batch, I reran the same command and it carried on. I then added a retry for dropped connections and tested it by killing and restarting Ollama during a run.&lt;/p&gt;

&lt;p&gt;The look lives in a JSON profile, not in the code: style words, things to avoid, the style questions with the answer each needs, and an optional recurring character.&lt;/p&gt;

&lt;p&gt;The rule that decides a pass is small:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;wrong&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;want&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;checks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;items&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;answers&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;want&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;failed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;wrong&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;soft&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;warnings&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;wrong&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;soft&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only the first question (the main subject) and the profile's non-soft style checks can fail an image. Questions two and three only warn. I chose that so a missing background detail wouldn't trigger a three-minute redraw. That choice turned out to be where the checker is weakest.&lt;/p&gt;

&lt;h3&gt;
  
  
  The optional Z-Image backend
&lt;/h3&gt;

&lt;p&gt;In my runs Z-Image Turbo followed prompts more closely than SDXL, but it is slower: 280 to 320 s per image against roughly 70 to 150 s for SDXL. Turbo has no negative prompt, so the "things to avoid" are never passed to it, and Gemma's checks have to catch them. On the four-shot storybook example, 3 passed in 36 minutes. The bakery shot failed the "readable text" check on all three attempts. I have only run that example on Z-Image, plus the 8-minute demo above.&lt;/p&gt;

&lt;h3&gt;
  
  
  How good is the checker?
&lt;/h3&gt;

&lt;p&gt;I labelled all 25 images from the current 16-shot run (SDXL drawing, Gemma 4 checking; 25 because misses were redrawn) &lt;code&gt;use&lt;/code&gt; or &lt;code&gt;no&lt;/code&gt; and compared my labels with Gemma's verdicts (&lt;code&gt;agreement.py&lt;/code&gt; is in the repo):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;I said use&lt;/th&gt;
&lt;th&gt;I said no&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Gemma passed&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Gemma failed&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwu5qhzbjqb6782w5bpv2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwu5qhzbjqb6782w5bpv2.png" alt="Gemma's pass and fail verdicts compared with my labels" width="799" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;They agree on 16 of 25 (64%). Cohen's kappa, which discounts chance agreement, is about 0.27. That is weak. When Gemma fails an image I agree 10 times in 13. When it passes one I accept it 6 times in 12, so a pass is a coin flip.&lt;/p&gt;

&lt;p&gt;All six bad passes have the same cause. Gemma answered "no" to an object the scene depended on (six different objects, one per image), but my rule only let question one fail an image. On my labels, requiring every question to be "yes" gives zero bad passes, nine extra redraws, and the same 16/25 agreement. I did not add it: it is tuned on the same 25 labels, so it isn't an independent test. It is the first thing I'd try next, as a &lt;code&gt;--strict&lt;/code&gt; flag.&lt;/p&gt;

&lt;p&gt;On the Z-Image storybook run I labelled 6 images and agreed with Gemma on 4.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Retries are free.&lt;/strong&gt; The design is "draw, check, redraw up to three times". With a per-image price or a rate limit, every redraw is a cost and I'd ration them. Here the laptop is already on, so I don't.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The checker can be inspected.&lt;/strong&gt; Gemma 4 is Apache 2.0, and I could read every answer it gave, put it next to my own labels and say exactly where it is wrong. That is how I found the six bad passes. A hosted checker can change under you between runs; this one is a file on my disk.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The painter is swappable.&lt;/strong&gt; Because the models are open files, I could add Z-Image Turbo as a second painter in a short change and compare it on the same shots.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scripts stay on the machine.&lt;/strong&gt; Unpublished video scripts and shop catalogues don't go to anyone's server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The licences are stated.&lt;/strong&gt; The code is MIT. SDXL base 1.0 is CreativeML Open RAIL++-M, which allows commercial use of generated images with use restrictions. Gemma 4 is Apache 2.0. For the optional backend, Z-Image Turbo and its Qwen3 text encoder are Apache 2.0, and so is the VAE file from the FLUX.1-schnell repo that I use with it; stable-diffusion.cpp is MIT. None of the model files are in the repo. This is my reading of the licences, not legal advice.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Lazy Payoff
&lt;/h2&gt;

&lt;p&gt;I made shots 01, 02, 03, 05 and 06 of the 16-shot list by hand in ChatGPT, with a reference image attached, and timed myself. It took about 5 to 7 minutes for 5 images. Each image took 20 to 30 seconds to generate, and the rest was me writing, looking and retrying (06 went twice because my first image looked too much like real currency). That is roughly 1 to 1.5 minutes of my attention per image, so about 16 to 22 minutes for 16 (extrapolated, not measured).&lt;/p&gt;

&lt;p&gt;Shotfill took 70 minutes for the same 16 images. So the payoff is &lt;strong&gt;not speed, and not quality&lt;/strong&gt;. The ChatGPT images are richer, at 1672×941 against 1024×576. What I get from Shotfill is that those 70 minutes need none of my attention, it costs nothing and works offline, and what I look at afterwards is a list of 4 shots, not 16 images. I didn't time that review, so I won't put a number on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;One laptop, one video script, one reviewer (me), 25 labels.&lt;/li&gt;
&lt;li&gt;The checker misses things: a "pass" is not a guarantee.&lt;/li&gt;
&lt;li&gt;Each image is drawn and checked on its own, so a recurring character can look different from shot to shot. Character consistency is not solved.&lt;/li&gt;
&lt;li&gt;Z-Image Turbo is slower, can't take an avoid list, and I have tested it on one four-shot example, not a full list.&lt;/li&gt;
&lt;li&gt;1024×576 is smaller and less detailed than a hosted image tool gives you.&lt;/li&gt;
&lt;li&gt;The full runs used &lt;code&gt;GPU.0&lt;/code&gt;. I ran one shot on the laptop's second GPU (&lt;code&gt;GPU.1&lt;/code&gt;): it passed, and drawing took 165 s. I did not test &lt;code&gt;CPU&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Best Use of Gemma.&lt;/strong&gt; Gemma 4 (&lt;code&gt;gemma4:e4b&lt;/code&gt;) does two jobs: it rewrites prompts into keywords with questions for the checker, and it looks at every image and answers them. The numbers above are how well that second job went.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>ai</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Restock: next week's order for small shops, from the sales file they already have</title>
      <dc:creator>Bikram Pun</dc:creator>
      <pubDate>Sun, 18 Oct 2026 15:40:21 +0000</pubDate>
      <link>https://dev.to/bikrampun/restock-next-weeks-order-for-small-shops-from-the-sales-file-they-already-have-5e18</link>
      <guid>https://dev.to/bikrampun/restock-next-weeks-order-for-small-shops-from-the-sales-file-they-already-have-5e18</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week2-2026-10-12"&gt;Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Small shops run out of their best sellers on their busiest days. Owners guess how much to order, and on a busy Saturday a guess often isn't enough: the croissants 🥐 are sold out by 10 a.m.&lt;/p&gt;

&lt;p&gt;I built Restock for a small mart in Hetauda, Nepal, that records every sale in a POS system and keeps running out of its best sellers during weekend offers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Restock&lt;/strong&gt; takes the sales file a shop already has, from a POS or Excel, and gives back:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;how much of each item it will likely sell next week&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;safe amount&lt;/strong&gt; that still covers a busy week&lt;/li&gt;
&lt;li&gt;an order message to copy and send to your supplier, on WhatsApp, SMS or email
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Order to cover Sun 18 Oct to Sat 24 Oct:
- Baguette: 176
- Banana bread slice: 258
- Cinnamon roll: 174
- Sourdough loaf: 247
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In the sample, croissants 🥐 aren't on the list: the 500 already on the shelf cover the week.&lt;/p&gt;

&lt;p&gt;No account, no store integration, no setup call. Upload one CSV, check which columns hold the date, item and units sold, and type what's on the shelf. If the file has a stock column, Restock fills that in for you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who would pay:&lt;/strong&gt; any small shop that loses sales when its best sellers run out, like a bakery, grocery or pharmacy. Running out on one busy day can lose more money than a small monthly fee, so Restock is worth paying for if it stops that from happening even once a month.&lt;/p&gt;

&lt;p&gt;Before showing a forecast, Restock tests itself on your own sales. It hides your last 7 days, predicts them, then checks how close it got, and compares that with the simple rule most owners use: "order the same as last week". If Restock does worse than that rule, it tells you, so you know before you spend money on an order.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Live:&lt;/strong&gt; &lt;a href="https://restock-4nle.onrender.com" rel="noopener noreferrer"&gt;https://restock-4nle.onrender.com&lt;/a&gt;. Click "Try it with sample bakery data", no file needed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0vm8rf80ape9htvsi7i2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0vm8rf80ape9htvsi7i2.png" alt="Restock start screen" width="800" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;That's the whole setup: one upload box, a sample button, and a plain note about where the data goes.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftrb5c9qgcpmhsqv03qxx.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftrb5c9qgcpmhsqv03qxx.gif" alt="Changing stock updates the order" width="800" height="596"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Change what's on the shelf and the order updates: 300 baguettes cover the week, so Baguette drops off; with only 200 croissants, Croissant joins the order.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fka1zafxjcc9jm1hjtyqh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fka1zafxjcc9jm1hjtyqh.png" alt="Next 7 days forecast table" width="800" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The forecast: what each item will likely sell, and the safe amount for a busy week.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsinuym33b9m9octwmyge.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsinuym33b9m9octwmyge.png" alt="Baguette sales and forecast chart" width="800" height="670"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;One item day by day: the last 4 weeks of actual sales, then the next 7 days with a quiet-to-busy range.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/bikrampun" rel="noopener noreferrer"&gt;
        bikrampun
      &lt;/a&gt; / &lt;a href="https://github.com/bikrampun/restock" rel="noopener noreferrer"&gt;
        restock
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Next week's demand per item for small shops, forecast with TabPFN (open-weight tabular model). Hacktoberfest 2026 DEV challenge.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Restock&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;Upload past sales, get next week's demand per item with a safe amount to prep or order. Built on &lt;a href="https://github.com/PriorLabs/TabPFN" rel="noopener noreferrer"&gt;TabPFN&lt;/a&gt;, an open-weight foundation model for tabular data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live demo:&lt;/strong&gt; &lt;a href="https://restock-4nle.onrender.com" rel="nofollow noopener noreferrer"&gt;https://restock-4nle.onrender.com&lt;/a&gt; (click "Try it with sample bakery data"; no file needed).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it works:&lt;/strong&gt; &lt;a href="https://dev.to/bikrampun/restock-next-weeks-order-for-small-shops-from-the-sales-file-they-already-have-5e18" rel="nofollow"&gt;Restock on DEV&lt;/a&gt;, with the architecture diagram and the accuracy check.&lt;/p&gt;

&lt;p&gt;Before showing a forecast, it hides your last 7 days, forecasts them, and tells you how far off it was compared with "same as last week".&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Run it&lt;/h2&gt;
&lt;/div&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;pip install -r requirements.txt
cp .env.example .env   &lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; then paste your free key from https://platform.priorlabs.ai/account/api-keys&lt;/span&gt;
streamlit run app.py&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Private mode: &lt;code&gt;pip install tabpfn&lt;/code&gt; and the app runs TabPFN-3.5's downloadable weights on your own machine instead of the API, so sales data stays on the laptop. First accept the non-commercial license at &lt;a href="https://platform.priorlabs.ai/accept-license" rel="nofollow noopener noreferrer"&gt;https://platform.priorlabs.ai/accept-license&lt;/a&gt;, signed in to the account whose key is in &lt;code&gt;.env&lt;/code&gt;. The…&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/bikrampun/restock" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;Repo: &lt;a href="https://github.com/bikrampun/restock" rel="noopener noreferrer"&gt;https://github.com/bikrampun/restock&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;About 230 lines of Python in one &lt;code&gt;app.py&lt;/code&gt;. The live app calls TabPFN with an API key; the test script, &lt;code&gt;check.py&lt;/code&gt;, swaps in a fake model so anyone can test the app without a key or spending credits.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffilg5c12hlnyw951mogt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffilg5c12hlnyw951mogt.png" alt="Restock architecture diagram" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The CSV is cleaned into daily totals, TabPFN forecasts the next 7 days, and the order is the safe amount minus what's on the shelf.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The model.&lt;/strong&gt; &lt;a href="https://github.com/PriorLabs/TabPFN" rel="noopener noreferrer"&gt;TabPFN&lt;/a&gt; is an AI model for spreadsheet-style data. It was trained in advance on millions of made-up tables, so it doesn't need training for each shop: you give it your rows and it predicts straight away. Prior Labs showed with &lt;a href="https://github.com/PriorLabs/tabpfn-time-series" rel="noopener noreferrer"&gt;TabPFN-TS&lt;/a&gt; that this works for sales forecasting too. For each day, Restock gives it five simple facts: the item, the day of the week (weekends sell more), the day of the month (paydays), the month (seasons), and a running day count (slow growth or decline).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cleaning a messy file.&lt;/strong&gt; Real exports are messy, so most of the code is cleanup:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one row per sale or one row per day both work; days with no sales count as zero&lt;/li&gt;
&lt;li&gt;dates can be &lt;code&gt;2026-08-01&lt;/code&gt; or day-first &lt;code&gt;01/08/2026&lt;/code&gt;, common outside the US&lt;/li&gt;
&lt;li&gt;"Croissant", "croissant " and "CROISSANT" become one item&lt;/li&gt;
&lt;li&gt;items under 3 weeks old, or with no sales in 2 weeks, are left out with a note&lt;/li&gt;
&lt;li&gt;problems point to the spreadsheet row, like &lt;code&gt;Row 12: "abc" isn't a number&lt;/code&gt;, so you can fix them in Excel&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3fpqpprt6wbd2qkbdmsh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3fpqpprt6wbd2qkbdmsh.png" alt="Messages for a messy CSV" width="800" height="817"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What a messy file looks like in Restock: blue notes for what it fixed by itself, yellow for what you should check, red for what you need to fix.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;From forecast to order.&lt;/strong&gt; TabPFN gives a range for each day, not one number: a quiet day, a normal day and a busy day. "Expected" adds up the normal days. "Safe amount" adds up the busy days, so it's enough even if the whole week runs busy. The order is the safe amount minus what's on the shelf:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Safe amount = sum of the 7 busy-day forecasts
Order       = max(0, Safe amount - In stock now)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For baguettes in the sample: a safe amount of 276, with 100 on the shelf, so order 176. An item with enough stock gets 0 and drops out of the message.&lt;/p&gt;

&lt;p&gt;For stock, Restock only trusts each item's &lt;strong&gt;latest&lt;/strong&gt; count. If that cell is blank, it shows 0 and names the row instead of using an older count. An older count is usually too high, which would make the order too small: the exact problem Restock exists to fix.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Honest numbers.&lt;/strong&gt; On the sample bakery data, TabPFN was off by 4.3 units per item per day, against 5.7 for "same as last week" (24% better). That data is made up with clean weekly patterns, and the app says so. Real shop sales are messier, so expect a smaller gain, and the app shows that number for your own file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stack.&lt;/strong&gt; Streamlit, pandas and &lt;code&gt;tabpfn-client&lt;/code&gt;, hosted free on Render. The live demo calls Prior Labs' API. If you install &lt;code&gt;tabpfn&lt;/code&gt;, the app switches to TabPFN's downloadable weights on your own laptop, so sales never leave it. &lt;del&gt;That path is coded but not yet tested end to end.&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update (Oct 19):&lt;/strong&gt; I've since tested private mode end to end: TabPFN-3.5's weights run on my laptop and work with Wi-Fi off, with the same forecast as the API.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;I read 24 public reviews of an established inventory forecasting tool on Capterra, Trustpilot, Reddit, Xero and Shopify. People like it, but the same complaint kept coming up: getting started. One reviewer wrote: "Initially navigating screen and tabs is confusing." Others thank the onboarding staff by name, because they needed help to get going. And every reviewer already ran their business on bigger software: Xero for accounting, a Shopify store, or a full business system (ERP).&lt;/p&gt;

&lt;p&gt;None of those 24 reviewers was a small local shop.&lt;/p&gt;

&lt;p&gt;An open, pre-trained model changes who can be served. Forecasting no longer needs a data team, a training pipeline or months of history. It needs one file. Prior Labs' free tier covers about 250 Restock runs a day (5 million daily credits, about 20,000 per run), so a free tool for small shops actually works. Anyone can read how Restock works, run it on their own laptop, or fork it for the shops in their town.&lt;/p&gt;

&lt;p&gt;One honest catch: TabPFN is free, but not for business use. To charge shops, I'd buy a licence from Prior Labs or switch to a free-for-business model like TimesFM or Chronos. Open models give me that choice. A closed AI service wouldn't.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of TabPFN:&lt;/strong&gt; TabPFN does all the forecasting. Its busy-day numbers decide how much to order, and a second TabPFN run tests the forecast against "same as last week" on the shop's own sales.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Render:&lt;/strong&gt; the app runs on Render's free plan from a one-file &lt;code&gt;render.yaml&lt;/code&gt;, with the TabPFN key kept as a Render secret.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Thanks to Prior Labs for publishing TabPFN, and to the Hacktoberfest team for a challenge that asked for something people would actually pay for.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>opensource</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
