F L U X.1 dev Lo R A Anti Blur
Shakker-LabsIntroduction
The FLUX.1-DEV-LORA-AntiBlur is a LoRA model trained on FLUX.1-dev, designed to enhance depth of field (DoF) without significantly degrading image quality. Developed by Vadim Fedenko and hosted on Shakker AI, it is a fundamental tool for image generation that can be combined with other components like ControlNet.
Architecture
This model is based on the FLUX.1-dev framework and leverages LoRA technology to improve image depth of field. It supports integration with the Diffusers library and is compatible with safetensors for secure model storage.
Training
The model was specifically trained to maintain image quality while enhancing depth of field. It does not require any trigger words, and the recommended scale for use in diffusers is between 1.0 and 1.5.
Guide: Running Locally
To run the FLUX.1-DEV-LORA-AntiBlur model locally, follow these steps:
-
Import necessary libraries:
import torch from diffusers import FluxPipeline
-
Load the pipeline and LoRA weights:
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16) pipe.load_lora_weights("Shakker-Labs/FLUX.1-dev-LoRA-AntiBlur", weight_name="FLUX-dev-lora-AntiBlur.safetensors") pipe.fuse_lora(lora_scale=1.5)
-
Move the pipeline to GPU:
pipe.to("cuda")
-
Generate an image with the desired prompt:
prompt = "a young college student, walking on the street, campus background, photography" image = pipe(prompt, num_inference_steps=24, guidance_scale=3.5, width=768, height=1024).images[0] image.save("example.png")
For optimal performance, consider using cloud GPUs like those available on AWS, Google Cloud, or Azure.
License
The model is released under the flux-1-dev-non-commercial-license. Refer to the license document for full terms and conditions.