DEV Community

Long Nguyen
Long Nguyen

Posted on

How I Built Intent Detection for a Chat-Based AI Comic Tool

Most AI comic generators are single-shot: prompt in, image out. That works fine until you need the same character to show up consistently across five panels — then you're re-describing everything from scratch every time and hoping the model cooperates.

I ran into this building AI Comic Lab (part of Netalith, a platform I run solo), and it pushed me to rethink the interaction model entirely. Instead of one input box that always does the same thing, the app needed to detect what the user actually wants — designing a character, planning a story structure, or generating art directly — and route the conversation accordingly.

A few things I learned building this:

1. Intent detection isn't a one-time classification
Early on I treated it as: classify the message, pick a mode, done. That breaks fast. A message like "make it darker" only makes sense with conversation context — it could mean "regenerate the last image with a darker tone" or "revise the story plan to be more serious." The classifier needs the last few turns, not just the current message.

2. Ambiguous input needs a fallback, not a guess
For genuinely unclear intent ("let's build a comic together, start wherever makes sense"), silently picking a mode and hoping it's right creates a worse experience than just asking. I ended up building a lightweight clarification path instead of forcing every message through hard classification.

3. Character consistency is a state problem, not a prompt problem
Getting a character to look the same across generations isn't really solved by writing a longer prompt — it's solved by treating the character as a stored object (reference image + structured traits) that gets attached to every subsequent generation involving them, rather than re-describing them in text each time.

4. Privacy constraints shaped the architecture more than I expected
I decided early that user prompts and generated content would never be used to train any model, and that meant being deliberate about what gets sent to the AI provider and what gets logged versus just stored for the user's own history. Worth designing that boundary before you have users, not after.

Stack-wise: Django + DRF backend, Postgres, the intent routing happens server-side before hitting the generation pipeline.

If you're curious about the actual product: I opened it up with 5 free credits, no card required — AI Comic Lab. Full writeup on how the chat modes work is here: Introducing AI Comic Lab, and the privacy/data-handling details are here: Privacy Policy.

Happy to go deeper on the intent-routing logic or the character-consistency implementation if anyone's interested — let me know in the comments.

Top comments (0)