derekl35's picture
Update README.md
b101a5a verified
metadata
base_model: black-forest-labs/FLUX.1-dev
library_name: diffusers
license: other
instance_prompt: a woman, alphonse mucha style
widget:
  - text: >-
      Serene raven-haired woman, moonlit lilies, swirling botanicals, alphonse
      mucha style
    output:
      url: images/alphonse_mucha_merged1_fp8.png
  - text: a puppy in a pond, alphonse mucha style
    output:
      url: images/alphonse_mucha_merged2_fp8.png
  - text: >-
      Ornate fox with a collar of autumn leaves and berries, amidst a tapestry
      of forest foliage, alphonse mucha style
    output:
      url: images/alphonse_mucha_merged3_fp8.png
tags:
  - text-to-image
  - diffusers-training
  - diffusers
  - lora
  - flux
  - flux-diffusers
  - template:sd-lora
datasets:
  - derekl35/alphonse-mucha-style

Flux DreamBooth LoRA - derekl35/alphonse-mucha-fp8-lora-flux

Prompt
Serene raven-haired woman, moonlit lilies, swirling botanicals, alphonse mucha style
Prompt
a puppy in a pond, alphonse mucha style
Prompt
Ornate fox with a collar of autumn leaves and berries, amidst a tapestry of forest foliage, alphonse mucha style

Model description

These are derekl35/alphonse-mucha-fp8-lora-flux DreamBooth LoRA weights for black-forest-labs/FLUX.1-dev. This work is part of the blog post, "Fine-Tuning FLUX.1-dev on consumer hardware and in FP8".

The weights were trained using DreamBooth with the Flux diffusers trainer.

Was LoRA for the text encoder enabled? False.

FP8 training? True

Trigger words

You should use , alphonse mucha style to trigger the image generation.

Download model

Download the *.safetensors LoRA in the Files & versions tab.

Use it with the 🧨 diffusers library

There are two main ways to use this LoRA for inference: loading the adapter on the fly or merging it with the base model.

Option 1: Loading LoRA Adapters

This approach offers flexibility, allowing you to easily switch between different LoRA styles.

from diffusers import FluxPipeline
import torch

ckpt_id = "black-forest-labs/FLUX.1-dev"
pipeline = FluxPipeline.from_pretrained(
    ckpt_id, torch_dtype=torch.float16
)
pipeline.load_lora_weights("derekl35/alphonse-mucha-fp8-lora-flux", weight_name="pytorch_lora_weights.safetensors")
pipeline.enable_model_cpu_offload()

image = pipeline(
    "a puppy in a pond, alphonse mucha style",
    num_inference_steps=28,
    guidance_scale=3.5,
    height=768,
    width=512,
    generator=torch.manual_seed(0)
).images[0]
image.save("alphonse_mucha_loaded.png")

Option 2: Merging LoRA into Base Model

Merging the LoRA into the base model can lead to slightly faster inference and is useful when you want to use a single style consistently.

from diffusers import FluxPipeline, AutoPipelineForText2Image, FluxTransformer2DModel
import torch

ckpt_id = "black-forest-labs/FLUX.1-dev"
pipeline = FluxPipeline.from_pretrained(
    ckpt_id, text_encoder=None, text_encoder_2=None, torch_dtype=torch.float16
)
pipeline.load_lora_weights("derekl35/alphonse-mucha-fp8-lora-flux", weight_name="pytorch_lora_weights.safetensors")
pipeline.fuse_lora()
pipeline.unload_lora_weights()

# You can save the fused transformer for later use
# pipeline.transformer.save_pretrained("fused_transformer")

pipeline.enable_model_cpu_offload()
image = pipeline(
    "a puppy in a pond, alphonse mucha style",
    num_inference_steps=28,
    guidance_scale=3.5,
    height=768,
    width=512,
    generator=torch.manual_seed(0)
).images[0]
image.save("alphonse_mucha_merged.png")

For more details, including weighting, merging and fusing LoRAs, check the documentation on loading LoRAs in diffusers

License

Please adhere to the licensing terms as described here.