ArtSpark — AI Creative Studio for Reverse-Engineering Visual Designs
Multimodal AI studio for prompt engineering, image style reverse-engineering, and high-fidelity text-to-image generation.
The Problem
Most AI art tools require users to already know complex prompting syntax (lighting models, lens types, aesthetic modifiers). When users see an inspiring artwork, they have no systematic way to deconstruct its visual parameters into a reproducible prompt.
Engineered ArtSpark to automate prompt alchemy across three tiers of detail (Simple, Detailed, Ultra-Detailed) and provide multimodal image reverse-engineering using Google Gemini 2.5 Flash, paired with dependable generation endpoints.
The System & Architecture
Next.js 14 App Router frontend interacting with a FastAPI backend that orchestrates Gemini 2.5 Flash for vision/prompt refinement and delegates generation to Freepik (Flux) with Pollinations.ai fallback.
ArtSpark Multimodal Synthesis Pipeline
Studio Client
Next.js 14 UI
Inference API
FastAPI (Python)
Gemini 2.5 Flash
Vision & Prompt Alchemy
Flux / Pollinations
Image Synthesis Pipeline
My Engineering Work
- Architected prompt expansion pipeline generating 3 granular tiers (Simple, Detailed, Ultra-Detailed) with selectable mood and lighting presets
- Built multimodal vision endpoint in FastAPI utilizing Gemini 2.5 Flash to reverse-engineer prompts from uploaded images
- Implemented automated fallback orchestration between Freepik Flux API and Pollinations.ai to guarantee generation availability
- Designed responsive studio interface with dark theme aesthetics, custom sliders, and smooth Framer Motion transitions
async def expand_prompt(base_prompt: str, tier: str, style: str) -> str:
system_instruction = f"Transform user ideas into {tier} prompts with {style} aesthetic."
response = await client.aio.models.generate_content(
model="gemini-2.5-flash",
contents=f"Subject: {base_prompt}",
config=types.GenerateContentConfig(system_instruction=system_instruction, temperature=0.7)
)
return response.textDecisions & Trade-offs
Challenge: Commercial image generation APIs occasionally hitting rate limits or intermittent timeouts
Solution: Implemented asynchronous polling in FastAPI with an automated fallback to Pollinations.ai when primary providers are unavailable
Challenge: Handling image payload transfers between Next.js and FastAPI without blocking the UI
Solution: Implemented base64 streaming and multipart uploads with asynchronous background processing
Validation & Limitations
- Streamlined prompt-to-render workflow enabling non-technical creators to generate high-fidelity digital art
- Robust fallback architecture maintaining uptime across provider rate-limit spikes
- Image generation on free-tier fallbacks can experience variable generation latency during peak hours
- Advanced canvas masking and inpainting are currently planned roadmap features
Evidence & Verification
Verify the implementation directly via source code, commit history, and setup documentation:
Ref: FastAPI OpenAPI documentation (/docs) and Next.js frontend setup instructions