MirAI School of Technology | Virtual Summer Internship 2026 — AI Builder Track Assignment: Upgrading the AI Image Studio
image.mp4
AI Image Studio is a Streamlit-based web application powered by the Pollinations AI API. This upgraded version transitions a working prototype into a feature-complete SaaS product by fixing critical dimension bugs, standardizing file exports, and introducing prompt-enhancement tools and creative shortcuts.
| Problem | The width/height sliders in the UI were disconnected from the backend generation URL, so generated images always used default fallback dimensions regardless of user selection. |
| Fix | Dynamically bind the slider values into the request URL query string: |
https://image.pollinations.ai/prompt/{encoded_prompt}?width={img_width}&height={img_height}&nologo=true
| Problem | Downloaded files had no explicit image extension, so operating systems registered them as unknown file types. |
| Fix | File names are generated dynamically from the selected art style, with .png enforced: |
file_name = f"{art_style}_image.png"| Problem | Short or low-detail prompts often produce sub-optimal generations. |
| Fix | Added a sidebar toggle, "Enable Magic Enhance," which appends quality-boosting descriptors — masterpiece, 8k resolution, highly detailed, trending on artstation, unreal engine 5 render — to the prompt before it's encoded. |
| Problem | Users hit prompt block or indecision. |
| Fix | A dedicated button uses random.choice() to pull from a curated list of detailed creative prompts (SURPRISE_PROMPTS), giving one-click inspiration. |
The app lives in a single modular Streamlit script (app.py):
- Configuration & Controls (
st.sidebar) — resolution sliders, art style selector, Magic Enhance toggle. - Preset Prompts Curation (
SURPRISE_PROMPTS) — array of baseline creative prompts. - Core Engine (
generate_image) — handles prompt formatting, URL encoding (urllib.parse), HTTP fetch (requests), response validation, and image byte-stream rendering. - Interactive Layout — two columns separating custom-prompt generation from one-click preset triggers.
- Python 3.10+
pip
pip install streamlit requests pillowstreamlit run app.pyThen open http://localhost:8501 in your browser.
| Layer | Technology |
|---|---|
| Frontend / App Framework | Streamlit |
| Image Processing | Pillow (PIL), io |
| HTTP Client | requests |
| AI Generation Backend | Pollinations AI |
This project was built as part of the MirAI School of Technology Virtual Summer Internship 2026.