FLUX.1-dev LoRA Hotswap (Img2Img)
This setup uses torch.compile
, BitsAndBytes
, and PEFT
LoRA to package the Flux.1 [dev] model, enabling fast image-to-image generation with LoRA adapter hotswapping via trigger words, along with quantization for efficiency.
Features
- Optimized Performance:
torch.compile
acceleration for faster inference. - Dynamic LoRA Switching: Instantly swap between multiple styles using trigger words.
- Memory Efficient: BitsAndBytes quantization reduces VRAM usage.
- Multi-Style Transformations: Two LoRAs preloaded for immediate style transfer.
Available Styles
Enhanced Image Preferences
- Trigger:
["Cinematic", "Photographic", "Anime", "Manga", "Digital art", "Pixel art", "Fantasy art", "Neonpunk", "3D Model", "Painting", "Animation", "Illustration"]
- LoRA: data-is-better-together/open-image-preferences-v1-flux-dev-lora
- Description: Applies refined stylistic preferences learned from curated data to your input image.
Ghibsky Illustration
- Trigger:
[GHIBSKY]
- LoRA: aleksa-codes/flux-ghibsky-illustration
- Description: Transforms your input image into Studio Ghibli–inspired sky and landscape illustrations.
Model Details
- Base Model: black-forest-labs/FLUX.1-dev
- Optimization: PyTorch 2.0 compilation + BitsAndBytes quantization with LoRA hot-swapping.
- Memory Usage: Reduced significantly via quantization.
Performance
- Speed: Up to 2× faster processing with
torch.compile
. - Memory: ~40% VRAM savings from quantization.
- Quality: Preserves FLUX.1-dev fidelity while restyling inputs.
- Flexibility: Supports on-the-fly LoRA switching without reloading.
Usage Tips
- Provide a clear input image (photo, sketch, concept art, or render).
- Add trigger words alongside your descriptive prompt to activate LoRA styles.
- Control the balance between input preservation and transformation using the strength parameter (
0.2–0.8
). - Works optimally at native FLUX.1-dev resolutions (1024×1024).
- Quantization enables efficient inference on consumer GPUs.
Note: Some GPU usage may persist after generation. Since LoRA hot-swapping is still evolving, occasional errors may occur. Please report issues if encountered.
Use Cases
- Transforming sketches or line art into polished illustrations.
- Stylizing photos into anime, cinematic, or fantasy aesthetics.
- Rapid experimentation with hybrid aesthetics by combining trigger words.
- Visual prototyping across multiple art styles without retraining.