Skip to content

Docs: 13 docstrings document parameters their functions don't have #15363

Description

@ishtiaq-ahmed-dev

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_weights documents unet_lora_layers; the parameter is transformer_lora_layers.
  • QuantizationConfigMixin.to_json_file documents use_diff, which it doesn't take (it always writes to_dict()).
  • utils.peft_utils.check_peft_version documents version; the parameter is min_version.
  • HunyuanImageRefinerPipeline.encode_prompt documents prompt_embeds_2 and prompt_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

  1. Shanmukh-l33t commented on Nov 24, 2026

    @Shanmukh-l33t

    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_layers to transformer_lora_layers, version to min_version, timesteps to w, specdict to spec_dict). The convert_from_ckpt.py entry is a format correction: the return: note under Args is now a proper Returns section, and the nonexistent is_img2img entry 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)?

  2. ishtiaq-ahmed-dev commented on Nov 24, 2026

    @ishtiaq-ahmed-dev
    ContributorAuthor

    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.

  3. yiyixuxu commented on Dec 1, 2026

    @yiyixuxu
    Collaborator
  4. stevhliu commented on Dec 1, 2026

    @stevhliu
    Member

    sorry for the delay! feel free to open a PR with the fix since you opened this issue @ishtiaq-ahmed-dev !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions