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

Flux训练的Lora无法工作,如何正确加载? #549

Open
DoiryCool opened this issue Oct 13, 2024 · 1 comment
Open

Flux训练的Lora无法工作,如何正确加载? #549

DoiryCool opened this issue Oct 13, 2024 · 1 comment

Comments

@DoiryCool
Copy link

import torch
from optimum.quanto import freeze, qfloat8, quantize
from diffusers import FluxPipeline, FluxTransformer2DModel
from PIL import Image
from safetensors.torch import load_file


transformer = FluxTransformer2DModel.from_single_file(
    "/models/Flux/FLUX.1-dev/flux1-dev-fp8.safetensors",
    torch_dtype=torch.float16,
)
pipe = FluxPipeline.from_pretrained(
    "/models/Flux/FLUX.1-dev",
    transformer=transformer,
    torch_dtype=torch.float16,
).to("cuda")


pipe.load_lora_weights("/models/output/bridge-arch-flux-000004.safetensors")

generator = torch.Generator().manual_seed(12345)
@liangcheng-1998
Copy link

我也是这样加载,和没加载生成的图一样

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