black-forest-labs / flux

Official inference repo for FLUX.1 models
Apache License 2.0
15.47k stars 1.11k forks source link

can't load pipline components with none error #33

Open opendb2 opened 2 months ago

opendb2 commented 2 months ago

Hi guys:

 I tried to run with following codes, but couldn't load pipline components and there was none error.

`import torch from diffusers import FluxPipeline

device = ( "mps" if torch.backends.mps.is_available() else "cuda" if torch.cuda.is_available() else "cpu" ) print("show pipe lines") pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16) print("load pipeline") pipe.enable_model_cpu_offload() #save some VRAM by offloading the model to CPU. Remove this if you have enough GPU power prompt = "A cat holding a sign that says hello world" image = pipe( prompt, guidance_scale=0.0, output_type="pil", num_inference_steps=4, max_sequence_length=256, generator=torch.Generator(device=device).manual_seed(0) ).images[0] print('draw') image.save("gc-img/shanshui_pil_4_246-2.webp")`

show in console:

32fe517514d88fee182c1cac8d74718

opendb2 commented 2 months ago

I print the pipline info of compoents, found it exit when load "FluxTransformer2DModel". 34f327381b7a68c599119118dd1e57c

opendb2 commented 2 months ago

fine. found the case due to there isn't enough SSD space left to load models (01-02,02-03,03-03.safetensors file).