Repository navigation
Conversation
The WaveSpeed provider never forwarded the LoRA adapter advertised by the
Hub's inferenceProviderMapping, so Python clients of WaveSpeed LoRA
mappings (e.g. Pika-Labs/Pika-H3-Flex, MiniMax H3 LoRAs) silently ran the
base model. Mirror @huggingface/inference (JS), which sends
loras: [{path: hf_model_id, scale: 1}] when mapping.adapter == 'lora'.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The WaveSpeed provider never forwards the LoRA adapter advertised by the Hub's
inferenceProviderMapping. For live WaveSpeed LoRA mappings — e.g.Pika-Labs/Pika-H3-Flex(image-to-video,adapter="lora") andpablodawson/MiniMax-H3-360-Orbit-LoRA(image-text-to-video) — a Python client silently runs the base model and the requested LoRA has no effect on the output.@huggingface/inference(JS) handles this inpackages/inference/src/providers/wavespeed.ts(WavespeedAITask.preparePayload): whenmapping.adapter === "lora"it addsloras: [{ path: mapping.hfModelId, scale: 1 }]to the payload. The Python SDK had no equivalent —wavespeed.pynever looks atadapter/adapter_weights_path, unlikefal_ai.py(#3005, #4706) andreplicate.py(#3054).Fix
Add a shared
_add_lorasonWavespeedAITask, called from both payload builders (text-to-image/text-to-videoandimage-to-image/image-to-video), mirroring the JS condition and payload shape.Tests
Two new payload tests in
TestWavespeedAIProvider, using real live mapping values:text-to-imagewithadapter="lora"addsloras: [{"path": "krea/Krea-2-Turbo", "scale": 1}]image-to-videowith the livePika-Labs/Pika-H3-Flexmapping adds the LoRA entryBoth fail on current
main(payload has noloraskey) and pass with the fix. Fulltests/test_inference_providers.py: 178 passed.ruff check/ruff format --checkclean.Note
Low Risk
Scoped change to WaveSpeed payload building with no effect when
adapteris notlora; tests lock expected shape.Overview
WaveSpeed inference payloads now include LoRA adapters when the Hub
inferenceProviderMappingsetsadapter="lora", matching@huggingface/inferencebehavior. Previously the Python client omittedloras, so LoRA-mapped models (e.g. image-to-video) ran without the adapter.A shared
_add_lorashelper onWavespeedAITaskinjectsloras: [{ "path": <hf_model_id>, "scale": 1 }]into text/image (and inherited video) task payloads. Tests cover text-to-image and image-to-video with real mapping examples.Reviewed by Cursor Bugbot for commit 6d82f8f. Bugbot is set up for automated code reviews on this repo. Configure here.