Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

🎨 AI Image Studio — Upgraded

MirAI School of Technology | Virtual Summer Internship 2026 — AI Builder Track Assignment: Upgrading the AI Image Studio

Python Streamlit License


🎬 Demo

image.mp4

📌 Overview

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.


✨ Core Features & Resolved Tasks

Task 1 — URL Parameter Query Fix (Broken Sliders)

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

Task 2 — Dynamic File Extension Fix

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"

Task 3 — Magic Enhance Toggle

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.

Task 4 — Random Prompt Generator ("Surprise Me!")

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.

🧱 Code Architecture

The app lives in a single modular Streamlit script (app.py):

  1. Configuration & Controls (st.sidebar) — resolution sliders, art style selector, Magic Enhance toggle.
  2. Preset Prompts Curation (SURPRISE_PROMPTS) — array of baseline creative prompts.
  3. Core Engine (generate_image) — handles prompt formatting, URL encoding (urllib.parse), HTTP fetch (requests), response validation, and image byte-stream rendering.
  4. Interactive Layout — two columns separating custom-prompt generation from one-click preset triggers.

🚀 Installation & Local Execution

Prerequisites

  • Python 3.10+
  • pip

Install dependencies

pip install streamlit requests pillow

Run

streamlit run app.py

Then open http://localhost:8501 in your browser.


🛠️ Tech Stack

Layer Technology
Frontend / App Framework Streamlit
Image Processing Pillow (PIL), io
HTTP Client requests
AI Generation Backend Pollinations AI

📄 License

This project was built as part of the MirAI School of Technology Virtual Summer Internship 2026.

About

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.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages