FLUX.1-dev-torchao-fp8

116
2
—
by
diffusers
Image Model
OTHER
New
116 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary

Visual comparison of Flux-dev model outputs using BF16 and torchao float8weightonly quantization To use this quantized FLUX.

Code Examples

python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")
python
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
    "diffusers/FLUX.1-dev-torchao-fp8",
    torch_dtype=torch.bfloat16,
    use_safetensors=False,
    device_map="balanced"
)
prompt = "Baroque style, a lavish palace interior with ornate gilded ceilings, intricate tapestries, and dramatic lighting over a grand staircase."
pipe_kwargs = {
    "prompt": prompt,
    "height": 1024,
    "width": 1024,
    "guidance_scale": 3.5,
    "num_inference_steps": 50,
    "max_sequence_length": 512,
}
image = pipe(
    **pipe_kwargs, generator=torch.manual_seed(0),
).images[0]
image.save("flux.png")

Deploy This Model

Production-ready deployment in minutes

Together.ai

Instant API access to this model

Fastest API

Production-ready inference API. Start free, scale to millions.

Try Free API

Replicate

One-click model deployment

Easiest Setup

Run models in the cloud with simple API. No DevOps required.

Deploy Now

Disclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.