Skip to content

flux2-klein lora train,bug #13866

@lspze

Description

@lspze

Describe the bug

path, 1662-1672: https://github.com/huggingface/diffusers/blob/main/examples/dreambooth/train_dreambooth_lora_flux2_klein_img2img.py

code:
cond_model_input_list = [cond_model_input[i].unsqueeze(0) for i in range(cond_model_input.shape[0])]
cond_model_input_ids = Flux2KleinPipeline._prepare_image_ids(cond_model_input_list).to(
device=cond_model_input.device
)
cond_model_input_ids = cond_model_input_ids.view(
cond_model_input.shape[0], -1, model_input_ids.shape[-1]
)

在这里,为什么要把同一个bacth里面的所有图像当成一组参考图来计算id,这样应该不对吧?应该只计算其中一张图片的id值,然后使用repeat来进行复制。这里一个batch的参考图之间应该是独立的。

Reproduction

thanks

Logs

System Info

  • 🤗 Diffusers version: 0.38.0
  • Platform: Linux-5.4.0-215-generic-x86_64-with-glibc2.31
  • Running on Google Colab?: No
  • Python version: 3.10.0
  • PyTorch version (GPU?): 2.9.1+cu128 (True)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Huggingface_hub version: 1.17.0
  • Transformers version: 5.9.0
  • Accelerate version: 1.12.0
  • PEFT version: 0.19.1
  • Bitsandbytes version: not installed
  • Safetensors version: 0.8.0-rc.1
  • xFormers version: 0.0.33.post2
  • Accelerator: NVIDIA A100 80GB PCIe, 81920 MiB
    NVIDIA A100 80GB PCIe, 81920 MiB
    NVIDIA A100 80GB PCIe, 81920 MiB
    NVIDIA A100 80GB PCIe, 81920 MiB
    NVIDIA A100 80GB PCIe, 81920 MiB
    NVIDIA A100 80GB PCIe, 81920 MiB
    NVIDIA A100 80GB PCIe, 81920 MiB
    NVIDIA A100 80GB PCIe, 81920 MiB
  • Using GPU in script?:
  • Using distributed or parallel set-up in script?:

Who can help?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingloraneeds-code-exampleWaiting for relevant code example to be providedpipelines

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions