Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crach #474

Open
werruww opened this issue Nov 27, 2024 · 4 comments
Open

crach #474

werruww opened this issue Nov 27, 2024 · 4 comments

Comments

@werruww
Copy link

werruww commented Nov 27, 2024

transformer_4bit = FluxTransformer2DModel.from_pretrained(ckpt_4bit_id, subfolder="transformer")
pipeline = FluxPipeline.from_pretrained(
ckpt_id,
text_encoder=None,
text_encoder_2=None,
tokenizer=None,
tokenizer_2=None,
transformer=transformer_4bit,
torch_dtype=torch.float16,
)
pipeline.enable_model_cpu_offload()

Your session crashed after using all available RAM.

in colab t4

@werruww
Copy link
Author

werruww commented Nov 27, 2024

from diffusers import FluxTransformer2DModel, FluxPipeline
import torch
model_id = "black-forest-labs/FLUX.1-dev"
nf4_id = "sayakpaul/flux.1-dev-nf4-with-bnb-integration"
model_nf4 = FluxTransformer2DModel.from_pretrained(nf4_id, torch_dtype=torch.bfloat16)
print(model_nf4.dtype)
print(model_nf4.config.quantization_config)
pipe = FluxPipeline.from_pretrained(model_id, transformer=model_nf4, torch_dtype=torch.bfloat16)
pipe.enable_model_cpu_offload()
prompt = "car"
image = pipe(prompt, guidance_scale=3.5, num_inference_steps=5, generator=torch.manual_seed(0)).images[0]
image.save("flux-nf4-dev-loaded.png")

Your session crashed after using all available RAM

in colab t4

@werruww
Copy link
Author

werruww commented Nov 27, 2024

?????????

@NielsRogge
Copy link
Owner

Hi,

See #471

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants