Instructions to use black-forest-labs/FLUX.1-dev with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use black-forest-labs/FLUX.1-dev with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
does it work with TensorRT for dev and schnell?
does it work with TensorRT?
Any minimal example available?
It seem onnx some operator not support torch.bfloat16 data type
Could this somehow help? https://github.com/microsoft/onnxscript/pull/1492
See also: https://github.com/microsoft/onnxruntime/issues/13001
and: https://github.com/microsoft/onnxscript/issues/1462
I found ComfyUI TensorRT node (https://github.com/comfyanonymous/ComfyUI_TensorRT/tree/master) support the bf16 Flux, but ComfyUI only supports t5xxl_fp16 (https://comfyanonymous.github.io/ComfyUI_examples/flux/).
Maybe the TensorRT node only convert the transformer, while the text encoders and vae need to be converted by other methods.
I found ComfyUI TensorRT node (https://github.com/comfyanonymous/ComfyUI_TensorRT/tree/master) support the bf16 Flux, but ComfyUI only supports t5xxl_fp16 (https://comfyanonymous.github.io/ComfyUI_examples/flux/).
Maybe the TensorRT node only convert the transformer, while the text encoders and vae need to be converted by other methods.
did you manage to convert only flux1_dev to onnx ? without text encoders.