# Flux.1-dev installation

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fflux-1-dev-installation%2F104719%3E%5C
**Category:** Models\
**Created:** [August 30, 2024, 11:19pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fflux-1-dev-installation%2F104719 "2024-08-30T23:19:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacula](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@jacula](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fjacula)%5C
**Post date:** [August 30, 2024, 11:19pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fflux-1-dev-installation%2F104719%2F1 "2024-08-30T23:19:52Z")

</div>

I see all the time the same problem when i try to run this code. Do you have any ideas? It looks like it was stopped midway.

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()

prompt = “a tiny astronaut hatching from an egg on the moon”  
out = pipe(  
prompt=prompt,  
guidance\_scale=3.5,  
height=768,  
width=1360,  
num\_inference\_steps=50,  
).images[0]  
out.save(“image.png”)

(venv) PS C:\Users\alf\Desktop\> python generate\_image.py  
Loading pipeline components…: 43%|██████████████████████▎ | 3/7 [00:00\<00:00, 27.43it/s]You set `add_prefix_space`. The tokenizer needs to be converted from the slow tokenizers  
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████| 2/2 [00:00\<00:00, 14.23it/s]  
Loading pipeline components…: 86%|████████████████████████████████████████████▌ | 6/7 [00:00\<00:00, 8.61it/s]  
(venv) PS C:\Users\alf\Desktop\>

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [August 31, 2024, 12:15am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fflux-1-dev-installation%2F104719%2F2 "2024-08-31T00:15:18Z")

</div>

Loading Flux into RAM or VRAM with bfloat16 requires a significant amount of RAM and VRAM, is it enough?  
I was experiencing a lack of RAM (probably) and freezing in the middle of the process (no error message, just stops).  
We could save a memory bit by loading it in float8, but right now the library is buggy and doesn’t seem to work.

As a solution, if the cause was insufficient RAM or VRAM, it may be somehow sufficient to load each component separately and quantize it.

## Details

> **[Flux](https://huggingface.co/docs/diffusers/main/en/api/pipelines/flux)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> <https://gist.github.com/VvanGemert/ab9c3ce63f12d429cf6075dbd764e57c>

> <https://github.com/huggingface/blog/blob/main/quanto-diffusers.md>

## About the Bug

[https://huggingface.co/Kijai/flux-fp8/discussions/4#66ce79dae0c8028b89a02c8d](https://huggingface.co/Kijai/flux-fp8/discussions/4#66ce79dae0c8028b89a02c8d)
