Repository navigation
Description
Describe the bug
Thirteen docstrings under src/diffusers document parameters that their functions don't have. Usually it's an old name left behind after a rename. Several are public API, so the wrong name shows up in the rendered docs and in IDE tooltips, and anyone who copies it gets a TypeError:
AmusedLoraLoaderMixin.save_lora_weightsdocumentsunet_lora_layers; the parameter istransformer_lora_layers.QuantizationConfigMixin.to_json_filedocumentsuse_diff, which it doesn't take (it always writesto_dict()).utils.peft_utils.check_peft_versiondocumentsversion; the parameter ismin_version.HunyuanImageRefinerPipeline.encode_promptdocumentsprompt_embeds_2andprompt_embeds_mask_2, which it doesn't take.
The full list (file:line function: documented name(s) missing from the signature):
guiders/guider_utils.py:202 _prepare_batch: input_fields
hooks/taylorseer_cache.py:315 _apply_taylorseer_cache_hook: name
loaders/lora_pipeline.py:2300 save_lora_weights: unet_lora_layers
modular_pipelines/modular_pipeline.py:2893 _dict_to_component_spec: specdict
pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion.py:648 get_guidance_scale_embedding: timesteps
pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion_img2img.py:720 get_guidance_scale_embedding: timesteps
pipelines/deprecated/i2vgen_xl/pipeline_i2vgen_xl.py:162 encode_prompt: do_classifier_free_guidance
pipelines/deprecated/shap_e/renderer.py:299 intersect: params
pipelines/deprecated/versatile_diffusion/pipeline_versatile_diffusion.py:302 dual_guided: negative_prompt
pipelines/hunyuan_image/pipeline_hunyuanimage_refiner.py:225 encode_prompt: prompt_embeds_2, prompt_embeds_mask_2
pipelines/stable_diffusion/convert_from_ckpt.py:1145 download_from_original_stable_diffusion_ckpt: is_img2img, return (the last is a Returns note placed under Args)
quantizers/quantization_config.py:97 to_json_file: use_diff
utils/peft_utils.py:381 check_peft_version: version
I found these by parsing every function with ast and comparing its Args: names with the signature. Functions with *args/**kwargs are skipped, so there are no false positives from forwarded arguments.
Proposed fix
A single docs-only PR that renames or removes the 13 entries, staying inside the docstrings. The five under pipelines/deprecated/ can be left out if you'd rather not touch deprecated code. Following the contributing guide, I'm checking here first: may I open that PR?
Reproduction
For example, check_peft_version(version="0.6.0") raises TypeError: check_peft_version() got an unexpected keyword argument 'version', as its docstring suggests that name.
System Info
main at the current HEAD; docstrings only.
Activity
Shanmukh-l33t commentedon Nov 24, 2026
I have a branch ready for this: all 13 entries re-checked against current main (every one still reproduces, same lines) and fixed in docstrings only. Parameters that no longer exist are dropped (
use_diff,prompt_embeds_2/prompt_embeds_mask_2,do_classifier_free_guidance, etc.) and renamed ones corrected (unet_lora_layerstotransformer_lora_layers,versiontomin_version,timestepstow,specdicttospec_dict). Theconvert_from_ckpt.pyentry is a format correction: thereturn:note under Args is now a proper Returns section, and the nonexistentis_img2imgentry is removed.An ast check of Args names vs signatures goes from 13 mismatches on main to 0 on the branch. Outside docstrings the AST is unchanged, compileall and ruff check/format pass on the 13 files. The five
pipelines/deprecated/edits are easy to drop if you prefer not to touch them.Branch: https://github.com/Shanmukh-l33t/diffusers/tree/docs/fix-docstring-param-names-15363
Compare: main...Shanmukh-l33t:diffusers:docs/fix-docstring-param-names-15363
Per the contribution guide, I haven't opened a PR. Could a maintainer confirm it's fine to open it from this branch (or tell me what to change)?
ishtiaq-ahmed-dev commentedon Nov 24, 2026
For context: I opened this issue with an offer to send the PR, and I'm still happy to do it as soon as a maintainer confirms the scope (including whether to leave out the five
pipelines/deprecated/files). If you'd rather take @Shanmukh-l33t's ready branch instead, that's completely fine with me. Either way, the main thing is getting these fixed.yiyixuxu commentedon Dec 1, 2026
cc @stevhliu
stevhliu commentedon Dec 1, 2026
sorry for the delay! feel free to open a PR with the fix since you opened this issue @ishtiaq-ahmed-dev !