-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[modular] add auto_docstring & more doc related refactors #12958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
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. |
| # ====================================================== | ||
|
|
||
| @classmethod | ||
| def prompt(cls) -> "InputParam": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
our pipeline parameter are pretty consistent across different pipelines, e.g. you always have prompt, height, width, num_inference_steps, etc. I made template for these common ones, so that it is easier to define
before you need
InputParam(
name="prompt",
type_hint=str,
required=True,
description="The prompt or prompts to guide image generation."
)now you do
InputParam.prompt()
InputParam.height(default=1024)
InputParam.num_inference_steps(default=28)
InputParam.generator()|
|
||
| # auto_docstring | ||
| class QwenImageAutoTextEncoderStep(AutoPipelineBlocks): | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are all auto generated docstring
| # ==================== | ||
|
|
||
|
|
||
| # auto_docstring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add this mark and then run
python utils/modular_auto_docstring.py --fix_and_overwrite
This PR adds a utility script
utils/modular_auto_docstring.pythat automatically generates docstrings for modular pipeline block classes from theirdocproperty.Usage
Mark classes with
# auto_docstringcomment:Run the script to insert docstrings: