Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP] SVDQuant#11950

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
DerekLiu35 wants to merge2 commits intohuggingface:main
base:main
Choose a base branch
Loading
fromDerekLiu35:svdquant-quantizer

Conversation

DerekLiu35
Copy link

What does this PR do?

right now just loads pre-quantized nunchaku model.

# INT-4 SVDQuantfromdiffusersimportFluxPipeline,FluxTransformer2DModelfromdiffusers.quantizers.quantization_configimportSVDQuantConfigimporttorchckpt_id="black-forest-labs/FLUX.1-dev"quant_id="mit-han-lab/svdq-int4-flux.1-dev"transformer=FluxTransformer2DModel.from_single_file(quant_id,quantization_config=SVDQuantConfig(),torch_dtype=torch.bfloat16,device_map="cuda",)pipe=FluxPipeline.from_pretrained(ckpt_id,transformer=transformer,torch_dtype=torch.bfloat16,).to("cuda")pipe_kwargs= {"prompt":"A cat holding a sign that says hello world","height":1024,"width":1024,"guidance_scale":3.5,"num_inference_steps":50,}image=pipe(generator=torch.manual_seed(0),**pipe_kwargs).images[0]image.save("svdq_int4.png")# BF16 baselinepipe=FluxPipeline.from_pretrained(ckpt_id,torch_dtype=torch.bfloat16,).to("cuda")image=pipe(generator=torch.manual_seed(0),**pipe_kwargs).images[0]image.save("bf16.png")

@HuggingFaceDocBuilderDev

The docs for this PR livehere. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@DerekLiu35@HuggingFaceDocBuilderDev

[8]ページ先頭

©2009-2025 Movatter.jp