A SwiftUI iOS app for generating and pixelating images using the RetroDiffusion API with modern Swift 6.2 concurrency and an actor-based architecture.
- Pixelate Tab: Select images from your photo library and convert them to pixel art using the
rd_pro__pixelatestyle- Real-time cost preview before pixelation
- Save pixelated images to your photo library
- Generate Tab: Generate pixel art images from text prompts using various RetroDiffusion model styles
- Debounced cost preview (updates after you stop typing)
- Model selection with 30+ styles (RD_PRO, RD_FAST, RD_PLUS)
- Customizable image dimensions
- Save generated images to your photo library
- Library: Persist generated/pixelated images in a SQLite-backed store with paging for large collections
- Async loading off the main thread via actors
- Lazy loading/pagination in the grid for smoother scrolling with large libraries
- iOS 26.1 or later
- Xcode 26.1 or later
- RetroDiffusion API key
- Create a
Config.plistfile in theRetroDiffusionAppdirectory if it doesn't exist - Add the following structure to the plist file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>API_KEY</key>
<string>YOUR_API_KEY_HERE</string>
</dict>
</plist>- Replace
YOUR_API_KEY_HEREwith your actual RetroDiffusion API key - Get your API key from RetroDiffusion Dev Tools
Important: The Config.plist file is already added to .gitignore to prevent committing your API key to version control.
- Swift 6.2 Concurrency: Heavy work runs on dedicated actors where stateful isolation is needed
- Services:
Networkingactor for API calls, wrapped by aNetworkClient(@MainActor @Observable) for SwiftUIImageUtilsandImageSaverstateless utilities used from background tasks to keep CPU and Photos writes off the main thread without cross-actor hopsLibraryStoreactor backed by SQLite for scalable persistence;LibraryClient(@MainActor @Observable) handles paging and caching for the UI
- SwiftUI + @Observable: Environment-injected clients; UI state remains local to views where possible
- Component-Based UI: Reusable SwiftUI components for generation, pixelation, library, and shared controls
For detailed API documentation, visit:
RetroDiffusionApp/
├── RetroDiffusionAppApp.swift # App entry point with service initialization
├── Config.plist # API key configuration (gitignored)
├── Assets.xcassets/ # App assets
│
├── actors/ # Actor-backed services (concurrency-safe)
│ ├── Networking.swift # Networking actor
│ └── LibraryStore.swift # SQLite-backed library actor
│
├── utils/ # Utilities
│ ├── ImageUtils.swift # Image resizing/base64 utilities
│ └── ImageSaver.swift # Photo library saver utilities
│
├── library/ # Library UI + client
│ ├── LibraryClient.swift # @MainActor wrapper for paging/caching over LibraryStore
│ ├── LibraryView.swift # Library grid with paging
│ ├── LibraryThumbnailView.swift# Async thumbnail loading
│ └── LibraryDetailView.swift # Full-size view/share
│
├── networking/ # Networking client layer
│ └── NetworkClient.swift # @MainActor wrapper over Networking actor
│
├── components/ # Shared UI components
│ └── … # Pixelate/Generate tabs, controls, etc.
│
├── models/ # Data models
│ └── Models.swift
│
└── utils/ # Misc constants/config
└── Constants.swift
- Open the "Pixelate" tab
- Tap "Choose Photo" to select an image from your photo library
- View the cost preview (automatically calculated)
- Tap "Pixelate Image" to convert it to pixel art
- View the original and pixelated images side-by-side
- Tap "Save to Photos" to save the pixelated image to your photo library
- Open the "Generate" tab
- Select a model style from the picker (30+ styles available)
- Enter a text prompt describing the image you want to generate
- Optionally adjust the width and height (default: 256x256)
- View the cost preview (updates automatically after you stop typing)
- Tap "Generate Image" to create pixel art
- View the generated image
- Tap "Save to Photos" to save the generated image to your photo library
- iOS 26.1+
- Swift 5.0+
- RetroDiffusion API account with credits