Following the AI-assisted contribution guide, I'm opening one issue for a recurring pattern rather than per-file PRs, and I'll wait for a maintainer's go-ahead before opening a PR.
The pattern
53 messages under src/diffusers contain {...} placeholders but are plain strings, not f-strings, so users see the placeholder text instead of the value. Every referenced name is in scope at its call site, so the fix is only the f prefix. Found with an AST scan for string literals passed to raise, logger.* or print whose placeholders name variables in the enclosing function; each hit was then read by hand.
1. Safety-checker ValueError in 46 pipelines (the most user-visible one)
raise ValueError(
"Make sure to define a feature extractor when loading {self.__class__} if you want to use the safety"
" checker. If you do not want to use the safety checker, you can pass `'safety_checker=None'` instead."
)
When safety_checker is passed without feature_extractor, the error reads ...when loading {self.__class__} if... instead of naming the pipeline class. None of these __init__s are # Copied from, so each copy needs the same one-character edit:
46 locations
pipelines/controlnet/pipeline_controlnet.py:239
pipelines/controlnet/pipeline_controlnet_img2img.py:217
pipelines/controlnet/pipeline_controlnet_inpaint.py:220
pipelines/controlnet_hunyuandit/pipeline_hunyuandit_controlnet.py:262
pipelines/deepfloyd_if/pipeline_if.py:153
pipelines/deepfloyd_if/pipeline_if_img2img.py:177
pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py:183
pipelines/deepfloyd_if/pipeline_if_inpainting.py:180
pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py:185
pipelines/deepfloyd_if/pipeline_if_superresolution.py:141
pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion.py:252
pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion_img2img.py:280
pipelines/deprecated/controlnet_xs/pipeline_controlnet_xs.py:177
pipelines/deprecated/semantic_stable_diffusion/pipeline_semantic_stable_diffusion.py:85
pipelines/deprecated/stable_diffusion_attend_and_excite/pipeline_stable_diffusion_attend_and_excite.py:245
pipelines/deprecated/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py:345
pipelines/deprecated/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py:169
pipelines/deprecated/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py:230
pipelines/deprecated/stable_diffusion_ldm3d/pipeline_stable_diffusion_ldm3d.py:260
pipelines/deprecated/stable_diffusion_panorama/pipeline_stable_diffusion_panorama.py:231
pipelines/deprecated/stable_diffusion_safe/pipeline_stable_diffusion_safe.py:125
pipelines/deprecated/stable_diffusion_variants/pipeline_cycle_diffusion.py:213
pipelines/deprecated/stable_diffusion_variants/pipeline_onnx_stable_diffusion_inpaint_legacy.py:138
pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_inpaint_legacy.py:183
pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_model_editing.py:111
pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_paradigms.py:135
pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_pix2pix_zero.py:353
pipelines/hunyuandit/pipeline_hunyuandit.py:235
pipelines/latent_consistency_models/pipeline_latent_consistency_text2img.py:207
pipelines/ledits_pp/pipeline_leditspp_stable_diffusion.py:367
pipelines/pag/pipeline_pag_controlnet_sd.py:247
pipelines/pag/pipeline_pag_controlnet_sd_inpaint.py:221
pipelines/pag/pipeline_pag_hunyuandit.py:240
pipelines/pag/pipeline_pag_sd.py:258
pipelines/pag/pipeline_pag_sd_img2img.py:253
pipelines/pag/pipeline_pag_sd_inpaint.py:285
pipelines/stable_diffusion/pipeline_onnx_stable_diffusion.py:101
pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_img2img.py:154
pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint.py:153
pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_upscale.py:127
pipelines/stable_diffusion/pipeline_stable_diffusion.py:253
pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py:103
pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py:281
pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py:228
pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py:154
pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py:256
2. DeepFloyd IF super-resolution warnings (3): "It seems like you have loaded a checkpoint that shall not be used for super resolution from {unet.config._name_or_path} as it accepts {unet.config.in_channels} input channels..." in pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py:189, pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py:191, pipelines/deepfloyd_if/pipeline_if_superresolution.py:147.
3. bitsandbytes quantizer (2): logger.info("target_dtype {target_dtype} is replaced by ...") in quantizers/bitsandbytes/bnb_quantizer.py:452, quantizers/bitsandbytes/bnb_quantizer.py:98.
4. DPMSolverSinglestepScheduler.set_timesteps warnings (2): "Changing scheduler {self.config} to have lower_order_final set to True..." in schedulers/scheduling_dpmsolver_singlestep.py:424, schedulers/scheduling_dpmsolver_singlestep.py:430.
Proposed fix
A single PR adding the f prefix at these 53 sites, with no other changes. It would pass make quality, make fix-copies (to confirm no copy checks drift), and the self-review skill, with the notes shared on the PR. There are also about 24 more copies of the safety-checker message under examples/community. I'd leave those out unless you'd like them in the same PR.
Would a PR along these lines be welcome?
Following the AI-assisted contribution guide, I'm opening one issue for a recurring pattern rather than per-file PRs, and I'll wait for a maintainer's go-ahead before opening a PR.
The pattern
53 messages under
src/diffuserscontain{...}placeholders but are plain strings, not f-strings, so users see the placeholder text instead of the value. Every referenced name is in scope at its call site, so the fix is only thefprefix. Found with an AST scan for string literals passed toraise,logger.*orprintwhose placeholders name variables in the enclosing function; each hit was then read by hand.1. Safety-checker
ValueErrorin 46 pipelines (the most user-visible one)When
safety_checkeris passed withoutfeature_extractor, the error reads...when loading {self.__class__} if...instead of naming the pipeline class. None of these__init__s are# Copied from, so each copy needs the same one-character edit:46 locations
pipelines/controlnet/pipeline_controlnet.py:239pipelines/controlnet/pipeline_controlnet_img2img.py:217pipelines/controlnet/pipeline_controlnet_inpaint.py:220pipelines/controlnet_hunyuandit/pipeline_hunyuandit_controlnet.py:262pipelines/deepfloyd_if/pipeline_if.py:153pipelines/deepfloyd_if/pipeline_if_img2img.py:177pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py:183pipelines/deepfloyd_if/pipeline_if_inpainting.py:180pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py:185pipelines/deepfloyd_if/pipeline_if_superresolution.py:141pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion.py:252pipelines/deprecated/alt_diffusion/pipeline_alt_diffusion_img2img.py:280pipelines/deprecated/controlnet_xs/pipeline_controlnet_xs.py:177pipelines/deprecated/semantic_stable_diffusion/pipeline_semantic_stable_diffusion.py:85pipelines/deprecated/stable_diffusion_attend_and_excite/pipeline_stable_diffusion_attend_and_excite.py:245pipelines/deprecated/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py:345pipelines/deprecated/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py:169pipelines/deprecated/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py:230pipelines/deprecated/stable_diffusion_ldm3d/pipeline_stable_diffusion_ldm3d.py:260pipelines/deprecated/stable_diffusion_panorama/pipeline_stable_diffusion_panorama.py:231pipelines/deprecated/stable_diffusion_safe/pipeline_stable_diffusion_safe.py:125pipelines/deprecated/stable_diffusion_variants/pipeline_cycle_diffusion.py:213pipelines/deprecated/stable_diffusion_variants/pipeline_onnx_stable_diffusion_inpaint_legacy.py:138pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_inpaint_legacy.py:183pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_model_editing.py:111pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_paradigms.py:135pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_pix2pix_zero.py:353pipelines/hunyuandit/pipeline_hunyuandit.py:235pipelines/latent_consistency_models/pipeline_latent_consistency_text2img.py:207pipelines/ledits_pp/pipeline_leditspp_stable_diffusion.py:367pipelines/pag/pipeline_pag_controlnet_sd.py:247pipelines/pag/pipeline_pag_controlnet_sd_inpaint.py:221pipelines/pag/pipeline_pag_hunyuandit.py:240pipelines/pag/pipeline_pag_sd.py:258pipelines/pag/pipeline_pag_sd_img2img.py:253pipelines/pag/pipeline_pag_sd_inpaint.py:285pipelines/stable_diffusion/pipeline_onnx_stable_diffusion.py:101pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_img2img.py:154pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint.py:153pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_upscale.py:127pipelines/stable_diffusion/pipeline_stable_diffusion.py:253pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py:103pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py:281pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py:228pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py:154pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py:2562. DeepFloyd IF super-resolution warnings (3):
"It seems like you have loaded a checkpoint that shall not be used for super resolution from {unet.config._name_or_path} as it accepts {unet.config.in_channels} input channels..."inpipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py:189,pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py:191,pipelines/deepfloyd_if/pipeline_if_superresolution.py:147.3. bitsandbytes quantizer (2):
logger.info("target_dtype {target_dtype} is replaced by ...")inquantizers/bitsandbytes/bnb_quantizer.py:452,quantizers/bitsandbytes/bnb_quantizer.py:98.4.
DPMSolverSinglestepScheduler.set_timestepswarnings (2):"Changing scheduler {self.config} to havelower_order_finalset to True..."inschedulers/scheduling_dpmsolver_singlestep.py:424,schedulers/scheduling_dpmsolver_singlestep.py:430.Proposed fix
A single PR adding the
fprefix at these 53 sites, with no other changes. It would passmake quality,make fix-copies(to confirm no copy checks drift), and the self-review skill, with the notes shared on the PR. There are also about 24 more copies of the safety-checker message underexamples/community. I'd leave those out unless you'd like them in the same PR.Would a PR along these lines be welcome?