Balck Images

#14
by primalfeasible - opened

Hi, I’m running into an issue with load_lora_weights() in this repo. After loading the LoRA weights, the output tensors always contain NaN, which makes the generated images completely black. Has anyone encountered this before or have any suggestions on how to fix it?

scheduler_config = {
        "base_image_seq_len": 256,
        "base_shift": math.log(3),  # We use shift=3 in distillation
        "invert_sigmas": False,
        "max_image_seq_len": 8192,
        "max_shift": math.log(3),  # We use shift=3 in distillation
        "num_train_timesteps": 1000,
        "shift": 1.0,
        "shift_terminal": None,  # set shift_terminal to None
        "stochastic_sampling": False,
        "time_shift_type": "exponential",
        "use_beta_sigmas": False,
        "use_dynamic_shifting": True,
        "use_exponential_sigmas": False,
        "use_karras_sigmas": False
}

model_name = "Qwen/Qwen-Image"
torch_dtype = torch.bfloat16
cache_dir = "/opt/hf-cache/hub"

scheduler = FlowMatchEulerDiscreteScheduler.from_config(scheduler_config)
pipe = DiffusionPipeline.from_pretrained(
        model_name,
        scheduler=scheduler,
        torch_dtype=torch_dtype,
        device_map="balanced",
        local_files_only=True,
        cache_dir=cache_dir,
)
pipe.load_lora_weights(
        "lightx2v/Qwen-Image-Lightning",
        weight_name="Qwen-Image-Lightning-8steps-V1.1-bf16.safetensors"
)

@primalfeasible
Hi, to reproduce our results, you may need to upgrade diffusers to v0.35.1 version, which enables loading Qwen-Image-Lightning lora weights.

Please check https://github.com/ModelTC/Qwen-Image-Lightning for our results, inference code and the prompt we used.

just dont start comfy with sage attention... or you get black output

Sign up or log in to comment