Urgent.News

What's breaking now, across thousands of outlets.

Tech

Debugging an image model without adding another sentence

I spent several days trying to make one photo come out as a graphite-pencil cartoon. Almost every fix was another sentence in the prompt. The pictures got less stable, not more. The useful change was the debugging loop, not a cleverer instruction. The loop I should have used first Freeze one photo. Print the exact string and the exact image list sent to the model. Change one input. Generate…

Debugging an image model involved a simple debugging loop: freeze a photo, print the exact string and image list sent to the model, then change one input and generate again. Before editing the text, it was crucial to name what the pixels did. Not every fix was an additional sentence in the prompt; in fact, the key change was the debugging loop itself.

By holding the photo still and having the model generate a new picture with a new paragraph, the difference became apparent. Logging the final prompt in full with a prefix was essential, as the summary often misrepresented the actual input. The first attempt involved pasting a vision-model analysis into the image prompt, leading to exaggerated features and unwanted objects appearing due to the metaphor introduced.

Splitting the work, the vision JSON was kept on the server and limited to generating a joke, while the image model received a concise order. Scaling neck, eye, and facial features helped refine the output, but each paragraph canceled the previous one, preventing comparison between generations. One key observation was that a side-eye feature, when exaggerated, resulted in a huge appearance, allowing for further exaggeration.

Another failure occurred when the model returned a 200 status code but an empty sentence, indicating that the debug tool was providing the raw response. Lastly, the prompt consisted of a single English line, instructing the model to create a black-and-white graphite pencil caricature focusing on the people in the photo and enlarging the named feature to make the joke visible at a glance.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Wednesday 23 September →