




SketchForge
From rough sketch to polished visual, powered by GPT Image 2.

RBU AI Assignment
Links
Team
1 member- SHOwner
Shivani Badule
Overview
SketchForge is a multimodal pipeline that converts a hand-drawn sketch, or a plain text idea, into a polished, production-ready image using the OpenAI API. The system uses two models deliberately, matched to the size of each job. A sketch is first read by a lightweight vision model (gpt-5.4-mini) through the Responses API, which returns a strict, schema-validated JSON description of the sketch's subject, style, color palette, layout, and mood. This structured output is then translated into a detailed, specific prompt and passed to gpt-image-2, OpenAI's current image model, which either generates a fresh polished image or edits the sketch directly. Text-only requests skip the vision step entirely, avoiding unnecessary cost. Robustness was treated as a first-class requirement rather than an afterthought: every API call is wrapped in retry logic with backoff, all user input is validated before any network call is made, and the vision model's structured output is checked against its schema before being trusted downstream. The API key is read exclusively from environment variables, with secrets excluded from version control. Example: a rough sketch of a brain-and-circuit concept, annotated "AI Week," is transformed into a clean, futuristic logo suitable for an event poster, with the full input, output, and generation prompt included for reproducibility.
