set_ip_adapter_scale(float) raises "Cannot assign 1 scale_configs to 2 IP-Adapter" when several IP-Adapters are loaded
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
既存のブロードキャスト動作を確認するため、IPAdapterMixin と ModularIPAdapterMixin の set_ip_adapter_scale を読み、FluxIPAdapterMixin.set_ip_adapter_scale も確認してください。issue では長さチェックの順序が指摘され、小さなパイプラインでの再現例が示されています。テスト用アダプターを2つ読み込んだ状態でfloatを1つ渡すケースのテストを追加し、スケールが両方に適用されることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
With more than one IP-Adapter loaded, set_ip_adapter_scale(0.6) raises ValueError: Cannot assign 1 scale_configs to 2 IP-Adapter. instead of applying the scale to every adapter. A list with one value per adapter works.
set_ip_adapter_scale already has a branch meant to repeat a single config for every adapter (elif len(scale_configs) == 1: scale_configs = scale_configs * len(attn_processor.scale)), but it comes after the length check, so it never runs. A single float was broadcast before #7668, and the Flux version (FluxIPAdapterMixin.set_ip_adapter_scale) still broadcasts it. The same code is in ModularIPAdapterMixin.set_ip_adapter_scale.
I'd like to send a PR that checks the single-config case first (a two-line swap in both mixins) plus a test.
Reproduction
Shown with the tiny test pipeline and two test IP-Adapters so it runs in seconds; it goes through the same set_ip_adapter_scale code as load_ip_adapter("h94/IP-Adapter", ...) with two weight_names on SD1.5.
# Run from the root of a diffusers checkout (uses the test helpers for a tiny pipeline and IP-Adapter weights).
from tests.models.unets.test_models_unet_2d_condition import create_ip_adapter_state_dict
from tests.pipelines.stable_diffusion.test_stable_diffusion import StableDiffusionPipelineTesterConfig
cfg = StableDiffusionPipelineTesterConfig()
pipe = cfg.pipeline_class(**cfg.get_dummy_components())
state_dicts = [create_ip_adapter_state_dict(pipe.unet) for _ in range(2)]
pipe.load_ip_adapter(state_dicts, subfolder=["", ""], weight_name=["", ""], image_encoder_folder=None)
pipe.set_ip_adapter_scale([0.6, 0.6]) # works
pipe.set_ip_adapter_scale(0.6) # ValueError
Context
I found this while testing set_ip_adapter_scale with two IP-Adapters loaded.
Logs
ValueError: Cannot assign 1 scale_configs to 2 IP-Adapter.
System Info
- 🤗 Diffusers version: 0.42.0.dev0 (main @ 84532a058)
- Platform: macOS-26.6.2-arm64-arm-64bit
- Running on Google Colab?: No
- Python version: 3.12.11
- PyTorch version (GPU?): 2.15.0 (False)
- Huggingface_hub version: 2.4.0
- Transformers version: 5.22.2
- Accelerate version: 1.15.0
- PEFT version: 0.21.2
- Safetensors version: 0.8.0
- xFormers version: not installed
- Accelerator: Apple M5 Pro
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No
Who can help?
@asomoza @yiyixuxu
- 主要言語
- Python
- スター
- 34.9k
- フォーク
- 7.5k
- 平均マージ
- 2日 16時間
- マージ済み PR(30日)
- 57
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
huggingface/diffusers のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
huggingface/diffusers#15211 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
UniPCMultistepScheduler.set_timesteps(sigmas=...) raises TypeError for a list when use_flow_sigmas=True対応中かも @marlonferreira1800-hue が 1 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
huggingface/diffusers#15207 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
huggingface/diffusers#15170 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
huggingface/diffusers#15163 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
`encode_video` truncates a fractional `fps`, so the video runs longer than its audio対応中かも @guptaishaan が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
huggingface/diffusers#15104 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
huggingface/diffusers の issue をすべて見る
似ている issue
-
cli good first issue help wanted python up-for-grabs
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
andrewsiah/agentswarm-data-tasks#36 ·
メンテナーはふだん 1 日以内に返信
-
bug drawing-tools
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
cofade/open-garden-planner#827 ·
メンテナーはふだん 1 日以内に返信
-
Methodology pageオープンdocumentation site texts
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
Krasnopjorovs/temet#66 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信