Flux Super Portrait v2 Lo R A

strangerzonehf

Introduction

The Flux-SuperPortrait-v2-LoRA model is a text-to-image model designed for generating high-quality portraits using the LoRA (Low-Rank Adaptation) technique. It leverages the capabilities of diffusion models and is intended for creating detailed and colorful images based on textual prompts.

Architecture

The model is based on the "black-forest-labs/FLUX.1-dev" base model and utilizes a LoRA approach to adapt pre-trained weights for specific tasks. It incorporates advanced parameters like multires noise and network dimensions to enhance image quality. The architecture utilizes a constant learning rate scheduler and the AdamW optimizer.

Training

  • Learning Parameters:

    • LR Scheduler: constant
    • Optimizer: AdamW
    • Network Dimension: 64
    • Network Alpha: 32
    • Noise Offset: 0.03
    • Multires Noise: Discount 0.1, Iterations 10
  • Training Details:

    • Total Images: 29 (4K resolution)
    • Epochs: 15
    • Repeat and Steps: 19 & 2890
  • Inference:

    • Recommended Dimensions: 1280 x 832 (3:2) or 1024 x 1024 (1:1)
    • Inference Steps: 30–35

Guide: Running Locally

To run the Flux-SuperPortrait-v2-LoRA model locally, follow these steps:

  1. Set Up Environment:

    • Ensure you have Python and PyTorch installed.
    • Install the diffusers library if not already available.
  2. Download the Model:

    • Obtain the model weights in Safetensors format from the Files & versions tab of the model repository.
  3. Load the Model:

    import torch
    from pipelines import DiffusionPipeline
    
    base_model = "black-forest-labs/FLUX.1-dev"
    pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
    
    lora_repo = "strangerzonehf/Flux-SuperPortrait-v2-LoRA"
    trigger_word = "Super Portrait v2"  
    pipe.load_lora_weights(lora_repo)
    
    device = torch.device("cuda")
    pipe.to(device)
    
  4. Generate Images:

    • Use the trigger word "Super Portrait v2" to start generating images.

Cloud GPUs: For optimal performance, consider using cloud services like AWS, Google Cloud, or Azure that provide GPU instances capable of running PyTorch models.

License

The Flux-SuperPortrait-v2-LoRA model is released under the CreativeML OpenRAIL-M license, which allows for open and flexible use while ensuring responsible AI deployment.

More Related APIs in Text To Image