Skip to content

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

Open

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

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