Flux Boom is a demo application showcasing how to use Flux models from Replicate in an iOS app. The goal of this project is to provide a clear and practical example for those interested in integrating generative AI models, allowing for experimentation and rapid prototyping.
-
Image Generation using Flux Models: Easily generate images using Flux models available through the Replicate API. Supports parameter control to adjust the output to your preferences.
-
Image Inpainting: Leverage Flux Dev to fill or modify specific parts of images, enabling creative edits directly within the app.
-
Parameter Control: Fine-tune parameters such as prompt, guidance scale, output quality, and more to get precisely the results you want from the generative models.
-
Image Gallery and Prompt History: Store generated images and track your prompt history. This helps visualize past experiments and compare different outputs.
-
Upload and Share Images: Integrate with the ImgBB API to upload generated images for inpainting/editing or provide image URLs.
-
SwiftUI: Built using SwiftUI for a modern and interactive UI, with a focus on clean code and easy maintainability.
-
Keychain Integration: Keychain usage in this demo is simplified and should be enhanced for production. API keys should never be stored on device.
-
Replicate API Integration: Provides examples of how to make RESTful API calls to Replicate, with the ability to swap in different model versions and endpoints.
-
State Management: Uses Swift's
@State
and@Environment
for efficient state management across views, showcasing best practices in a SwiftUI environment.
-
Clone the Repository
git clone https://github.com/samroman3/FluxBoom.git cd fluxBoom
-
Add API Keys
-
Open in Xcode
- Open the project in Xcode (
fluxBoom.xcodeproj
). - Make sure you have a recent version of Xcode that supports SwiftUI.
- Open the project in Xcode (
-
Run the App
- Compile and run the app on a simulator or an actual device to see how Flux Boom interacts with the models and generates images.
This app is intended as a developer demonstration, not for production use. As such, some practices (e.g., error handling, security considerations) are simplified for clarity and to focus on the core capabilities of the app:
- Security: Hardcoded URLs and simplified Keychain usage are employed for demonstration purposes. Sensitive information should be handled more securely in a production environment.
Contributions are welcome! If you have improvements or suggestions, feel free to open an issue or submit a pull request. This project was intended as a learning tool for myself, so any enhancements that add to the educational value are greatly appreciated.