RetroDiffusion iOS App
iOS app for https://retrodiffusion.ai/app/devtools
README
RetroDiffusion iOS App
A SwiftUI iOS app for generating and pixelating images using the RetroDiffusion API with modern Swift 6.2 concurrency and an actor-based architecture.
Features
- 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
Setup
Prerequisites
- iOS 26.1 or later
- Xcode 26.1 or later
- RetroDiffusion API key
API Key Configuration
- 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.
Architecture
- 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
API Documentation
For detailed API documentation, visit:
Project Structure
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
Usage
Pixelate Images
- 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
Generate Images
- 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
Requirements
- iOS 26.1+
- Swift 5.0+
- RetroDiffusion API account with credits
