F L U X.1 Redux dev

black-forest-labs

FLUX.1 Redux [dev] Documentation

Introduction

FLUX.1 Redux [dev] is an adapter designed for FLUX.1 base models to generate image variations. It allows users to refine and restyle images, integrating smoothly into complex workflows. Users can also utilize a text prompt alongside an image for restyling via API.

Architecture

The model is built to adapt FLUX.1 base models, focusing on image restyling and variation generation. It supports integration with diffusers, a Python library, to facilitate image generation workflows.

Training

FLUX.1 Redux [dev] is optimized for image restyling and variation. It uses advanced pipelines to process and modify images based on input prompts and images, leveraging state-of-the-art techniques in diffusion models.

Guide: Running Locally

  1. Install Diffusers:
    Ensure you have the latest version of the diffusers library:

    pip install -U diffusers
    
  2. Set Up Pipelines:
    Import necessary modules and set up the pipelines using the provided code snippet:

    import torch
    from diffusers import FluxPriorReduxPipeline, FluxPipeline
    from diffusers.utils import load_image
    
    pipe_prior_redux = FluxPriorReduxPipeline.from_pretrained(
        "black-forest-labs/FLUX.1-Redux-dev", torch_dtype=torch.bfloat16).to("cuda")
    pipe = FluxPipeline.from_pretrained(
        "black-forest-labs/FLUX.1-dev", 
        text_encoder=None,
        text_encoder_2=None,
        torch_dtype=torch.bfloat16
    ).to("cuda")
    
    image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/robot.png")
    pipe_prior_output = pipe_prior_redux(image)
    images = pipe(
        guidance_scale=2.5,
        num_inference_steps=50,
        generator=torch.Generator("cpu").manual_seed(0),
        **pipe_prior_output,
    ).images
    images[0].save("flux-dev-redux.png")
    
  3. Run on Cloud GPUs:
    For optimal performance, use cloud GPU services such as AWS, Google Cloud, or Azure to handle intensive computations.

License

FLUX.1 Redux [dev] is distributed under the FLUX.1 [dev] Non-Commercial License. For detailed terms, refer to the license document.

More Related APIs