A simple and powerful SwiftUI app that generates beautiful AI illustrations from text prompts using Apple's ImagePlayground framework. Just type a prompt and watch your imagination come to life — all on-device and lightning fast.
- ✅ Prompt-based image generation
- 🎨 Uses
ImagePlayground's.illustrationstyle - 🧠 Async image generation with Swift concurrency
⚠️ Graceful error handling- 🚀 Built entirely in SwiftUI
- Xcode 16+
- iOS 18+
- Swift Concurrency support (iOS 15+ baseline if using modern SwiftUI)
-
Clone the repo:
git clone https://github.com/mizadi/AIImageGenerator.git
-
Open the project in Xcode:
open AIImageGenerator.xcodeproj
-
Build and run on an iOS 18+ simulator or device.
🔒 No API keys, no cloud dependencies — the app uses Apple’s on-device AI image generation.
- Launch the app
- Type any creative prompt into the input field
- Tap "Generate Image"
- Wait a few seconds — your illustration will appear!
Prompt:
A cat wearing sunglasses surfing a wave
Result:
⚠️ Your results may vary — ImagePlayground creates new images every time based on the prompt and style.
. ├── PromptImageView.swift # Main SwiftUI interface ├── ImageGenerator.swift # Image generation logic ├── AIImageGeneratorApp.swift # App entry point ├── Assets.xcassets # App icons & colors ├── example/ │ └── cat-surfing.png # Example result image └── README.md This project is licensed under the MIT License. Feel free to fork, use, and build on it.
Thanks to Apple for introducing ImagePlayground and on-device creativity tools. This app was inspired by the potential of AI and SwiftUI together.
