Instructions to use bb1070/cfb_fp8_torchao with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use bb1070/cfb_fp8_torchao with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import FluxFillPipeline from diffusers.utils import load_image image = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup.png") mask = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup_mask.png") # switch to "mps" for apple devices pipe = FluxFillPipeline.from_pretrained("bb1070/cfb_fp8_torchao", dtype=torch.bfloat16, device_map="cuda") image = pipe( prompt="a white paper cup", image=image, mask_image=mask, height=1632, width=1232, guidance_scale=30, num_inference_steps=50, max_sequence_length=512, generator=torch.Generator("cpu").manual_seed(0) ).images[0] image.save(f"flux-fill-dev.png") - Notebooks
- Google Colab
- Kaggle
Download transformer/config.json from bb1070/cfb_fp8_torchao: direct link, hf CLI and curl.
- Browser
- Download file 699 Bytes
-
https://huggingface.co/bb1070/cfb_fp8_torchao/resolve/main/transformer/config.json
- Command line
-
hf download hf://bb1070/cfb_fp8_torchao/transformer/config.json
-
curl -L -o config.json https://huggingface.co/bb1070/cfb_fp8_torchao/resolve/main/transformer/config.json
699 Bytes
| { | |
| "_class_name": "FluxTransformer2DModel", | |
| "_diffusers_version": "0.34.0", | |
| "_name_or_path": "/root/.cache/huggingface/hub/models--bb1070--cfb_bf16_full/snapshots/52b7ac1350cd6f2d0b7779d17ba81f9dcbd7e8d7/transformer", | |
| "attention_head_dim": 128, | |
| "axes_dims_rope": [ | |
| 16, | |
| 56, | |
| 56 | |
| ], | |
| "guidance_embeds": true, | |
| "in_channels": 384, | |
| "joint_attention_dim": 4096, | |
| "num_attention_heads": 24, | |
| "num_layers": 19, | |
| "num_single_layers": 38, | |
| "out_channels": 64, | |
| "patch_size": 1, | |
| "pooled_projection_dim": 768, | |
| "quantization_config": { | |
| "modules_to_not_convert": null, | |
| "quant_method": "torchao", | |
| "quant_type": "float8_weight_only", | |
| "quant_type_kwargs": {} | |
| } | |
| } | |