You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[modular] add auto_docstring & more doc related refactors (#12958)
* up
* up up
* update outputs
* style
* add modular_auto_docstring!
* more auto docstring
* style
* up up up
* more more
* up
* address feedbacks
* add TODO in the description for empty docstring
* refactor based on dhruv's feedback: remove the class method
* add template method
* up
* up up up
* apply auto docstring
* make style
* rmove space in make docstring
* Apply suggestions from code review
* revert change in z
* fix
* Apply style fixes
* include auto-docstring check in the modular ci. (#13004)
* Run ruff format after auto docstring generation
* up
* upup
* upup
* style
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sayak Paul <[email protected]>
Copy file name to clipboardExpand all lines: .github/workflows/pr_modular_tests.yml
+19-1Lines changed: 19 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -75,9 +75,27 @@ jobs:
75
75
if: ${{ failure() }}
76
76
run: |
77
77
echo "Repo consistency check failed. Please ensure the right dependency versions are installed with 'pip install -e .[quality]' and run 'make fix-copies'" >> $GITHUB_STEP_SUMMARY
"description": "Additional kwargs for attention processors.",
398
+
},
399
+
"denoiser_input_fields": {
400
+
"name": None,
401
+
"kwargs_type": "denoiser_input_fields",
402
+
"description": "conditional model inputs for the denoiser: e.g. prompt_embeds, negative_prompt_embeds, etc.",
403
+
},
404
+
# inpainting
405
+
"mask_image": {
406
+
"type_hint": PIL.Image.Image,
407
+
"required": True,
408
+
"description": "Mask image for inpainting.",
409
+
},
410
+
"padding_mask_crop": {
411
+
"type_hint": int,
412
+
"description": "Padding for mask cropping in inpainting.",
413
+
},
414
+
# controlnet
415
+
"control_image": {
416
+
"type_hint": PIL.Image.Image,
417
+
"required": True,
418
+
"description": "Control image for ControlNet conditioning.",
419
+
},
420
+
"control_guidance_start": {
421
+
"type_hint": float,
422
+
"default": 0.0,
423
+
"description": "When to start applying ControlNet.",
424
+
},
425
+
"control_guidance_end": {
426
+
"type_hint": float,
427
+
"default": 1.0,
428
+
"description": "When to stop applying ControlNet.",
429
+
},
430
+
"controlnet_conditioning_scale": {
431
+
"type_hint": float,
432
+
"default": 1.0,
433
+
"description": "Scale for ControlNet conditioning.",
434
+
},
435
+
"layers": {
436
+
"type_hint": int,
437
+
"default": 4,
438
+
"description": "Number of layers to extract from the image",
439
+
},
440
+
# common intermediate inputs
441
+
"prompt_embeds": {
442
+
"type_hint": torch.Tensor,
443
+
"required": True,
444
+
"description": "text embeddings used to guide the image generation. Can be generated from text_encoder step.",
445
+
},
446
+
"prompt_embeds_mask": {
447
+
"type_hint": torch.Tensor,
448
+
"required": True,
449
+
"description": "mask for the text embeddings. Can be generated from text_encoder step.",
450
+
},
451
+
"negative_prompt_embeds": {
452
+
"type_hint": torch.Tensor,
453
+
"description": "negative text embeddings used to guide the image generation. Can be generated from text_encoder step.",
454
+
},
455
+
"negative_prompt_embeds_mask": {
456
+
"type_hint": torch.Tensor,
457
+
"description": "mask for the negative text embeddings. Can be generated from text_encoder step.",
458
+
},
459
+
"image_latents": {
460
+
"type_hint": torch.Tensor,
461
+
"required": True,
462
+
"description": "image latents used to guide the image generation. Can be generated from vae_encoder step.",
463
+
},
464
+
"batch_size": {
465
+
"type_hint": int,
466
+
"default": 1,
467
+
"description": "Number of prompts, the final batch size of model inputs should be batch_size * num_images_per_prompt. Can be generated in input step.",
468
+
},
469
+
"dtype": {
470
+
"type_hint": torch.dtype,
471
+
"default": torch.float32,
472
+
"description": "The dtype of the model inputs, can be generated in input step.",
473
+
},
474
+
}
475
+
476
+
OUTPUT_PARAM_TEMPLATES= {
477
+
"images": {
478
+
"type_hint": List[PIL.Image.Image],
479
+
"description": "Generated images.",
480
+
},
481
+
"latents": {
482
+
"type_hint": torch.Tensor,
483
+
"description": "Denoised latents.",
484
+
},
485
+
# intermediate outputs
486
+
"prompt_embeds": {
487
+
"type_hint": torch.Tensor,
488
+
"kwargs_type": "denoiser_input_fields",
489
+
"description": "The prompt embeddings.",
490
+
},
491
+
"prompt_embeds_mask": {
492
+
"type_hint": torch.Tensor,
493
+
"kwargs_type": "denoiser_input_fields",
494
+
"description": "The encoder attention mask.",
495
+
},
496
+
"negative_prompt_embeds": {
497
+
"type_hint": torch.Tensor,
498
+
"kwargs_type": "denoiser_input_fields",
499
+
"description": "The negative prompt embeddings.",
500
+
},
501
+
"negative_prompt_embeds_mask": {
502
+
"type_hint": torch.Tensor,
503
+
"kwargs_type": "denoiser_input_fields",
504
+
"description": "The negative prompt embeddings mask.",
505
+
},
506
+
"image_latents": {
507
+
"type_hint": torch.Tensor,
508
+
"description": "The latent representation of the input image.",
509
+
},
510
+
}
511
+
512
+
331
513
@dataclass
332
514
classInputParam:
333
515
"""Specification for an input parameter."""
@@ -337,11 +519,31 @@ class InputParam:
337
519
default: Any=None
338
520
required: bool=False
339
521
description: str=""
340
-
kwargs_type: str=None# YiYi Notes: remove this feature (maybe)
0 commit comments