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.illustration
style - π§ 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.