BlackForestLabs HuggingFace

HuggingFace

Welcome to Black Forest Labs’ Hugging Face Spaces, where innovation meets advanced AI modeling. BFL specializes in developing state-of-the-art models designed for diverse applications, from natural language processing to image generation. BlackForestLab’s Hugging Face Spaces serve as a hub for AI enthusiasts, developers, and researchers to explore, test, and implement cutting-edge AI tools with ease. Discover collection of models, optimized for performance and ease of use, and unlock new possibilities in your projects with the expertise of Black Forest Labs.

FLUX.1 [dev] Overview

FLUX.1 [dev] is a 12-billion-parameter rectified flow transformer designed to generate images from textual prompts with precision. For more details, check out our blog post.

Key Features

  • High-Quality Outputs: FLUX.1 [dev] delivers top-tier output quality, second only to our flagship FLUX.1 [pro] model.
  • Competitive Prompt Adherence: Its prompt-following capabilities rival those of leading closed-source models.
  • Efficiency through Guidance Distillation: The model is optimized for efficiency thanks to guidance distillation techniques.
  • Open Access for Research and Creativity: The model’s open weights encourage new scientific research and empower artists to develop creative workflows.
  • Flexible Licensing: Outputs can be used for personal, scientific, and commercial projects under the FLUX.1 [dev] Non-Commercial License.

How to Get Started

We offer a reference implementation of FLUX.1 [dev], along with sampling code, available in our dedicated GitHub repository. It’s an excellent starting point for developers and creatives looking to build upon the model’s capabilities.

API Endpoints

Access the FLUX.1 models through API from these platforms:

Local Inference with ComfyUI

Use FLUX.1 [dev] within ComfyUI for local inference with a user-friendly, node-based workflow.

Integration with Diffusers

To integrate FLUX.1 [dev] with the 🧨 diffusers Python library, start by installing or upgrading diffusers:

pip install -U diffusers

Then, use the following example code to run the model:

import torch
from diffusers import FluxPipeline

pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
pipe.enable_model_cpu_offload()  # Offload model to CPU to save VRAM if needed

prompt = "A cat holding a sign that says hello world"
image = pipe(
    prompt,
    height=1024,
    width=1024,
    guidance_scale=3.5,
    num_inference_steps=50,
    max_sequence_length=512,
    generator=torch.Generator("cpu").manual_seed(0)
).images[0]
image.save("flux-dev.png")

For more details, visit the diffusers documentation.

Limitations

  • Not for Factual Information: This model is not intended to provide accurate factual responses.
  • Bias Amplification: Being a statistical model, it may reflect societal biases.
  • Prompt Sensitivity: The quality of generated output can vary significantly based on prompt style.

Prohibited Uses

FLUX.1 [dev] and its derivatives cannot be used for:

  • Illegal activities or violations of applicable laws.
  • Any form of exploitation, harm, or solicitation involving minors.
  • Generating or spreading false information aimed at causing harm.
  • Disseminating personal information that could be harmful to individuals.
  • Harassment, abuse, or threats toward individuals or groups.
  • Creating non-consensual explicit content.
  • Automated decision-making that impacts legal rights or obligations.
  • Facilitating large-scale disinformation campaigns.

Licensing

FLUX.1 [dev] is released under the FLUX.1 [dev] Non-Commercial License, allowing users to explore its capabilities while adhering to the specified guidelines.

FLUX.1 [dev] Model Demo

FLUX.1 [schnell] Overview

FLUX.1 [schnell] is a 12-billion-parameter rectified flow transformer, capable of transforming text descriptions into highly realistic images. For further details, check out our blog post.

Key Features

  • Advanced Image Generation: Delivers top-quality outputs with prompt-following capabilities that rival closed-source models.
  • Efficient Training: Utilizes latent adversarial diffusion distillation, enabling high-quality image generation in just 1 to 4 steps.
  • Flexible Licensing: Released under the Apache-2.0 license, allowing use for personal, scientific, and commercial projects.

How to Get Started

We offer a reference implementation and sampling code for FLUX.1 [schnell] in our GitHub repository, providing an ideal starting point for developers and creators aiming to build upon its capabilities.

API Endpoints

Access FLUX.1 models through API at the following sources:

Local Inference with ComfyUI

FLUX.1 [schnell] is also compatible with ComfyUI, enabling local inference with a streamlined, node-based interface.

Integration with Diffusers

To integrate FLUX.1 [schnell] using the 🧨 diffusers Python library, first install or update the library:

pip install -U diffusers

Then, use the following code to run the model:

import torch
from diffusers import FluxPipeline

pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16)
pipe.enable_model_cpu_offload()  # Offload to CPU if needed

prompt = "A cat holding a sign that says hello world"
image = pipe(
    prompt,
    guidance_scale=0.0,
    num_inference_steps=4,
    max_sequence_length=256,
    generator=torch.Generator("cpu").manual_seed(0)
).images[0]
image.save("flux-schnell.png")

For more details, refer to the diffusers documentation.

Limitations

  • Not for Factual Content: This model is not designed to provide accurate factual responses.
  • Potential Bias: As a statistical model, it may reflect societal biases.
  • Prompt Sensitivity: The output quality may vary based on the structure and wording of the prompt.

Prohibited Uses

FLUX.1 [schnell] and its derivatives cannot be used for:

  • Activities that violate laws and regulations at any level.
  • Exploiting, harming, or attempting to exploit minors, including the creation or distribution of child exploitative content.
  • Generating or disseminating false information intended to harm others.
  • Distributing personal information that could be used to harm individuals.
  • Harassing, abusing, threatening, or bullying individuals or groups.
  • Creating non-consensual explicit content.
  • Automated decision-making that impacts legal rights or creates binding obligations.
  • Facilitating large-scale disinformation campaigns.

FLUX.1 [schnell] Model Demo

Read more about FLUX in our Blog:


Posted