Uh oh!
There was an error while loading. Please reload this page.
Add Differential Diffusion to HunyuanDiT. - #9040
Conversation
a-r-r-o-w
left a comment
There was a problem hiding this comment.
Thank you for working on this, looks good to me! I think we can merge this once you add your name and contrib to the community README file. Also, seems like at place of the code, the style guide is not followed. Normally, these could be fixed with make style if it was a pipeline in core diffusers. However, since this is a community pipeline, you can run styling with:ruff check examples/community/pipeline_hunyuandit_differential_img2img.py --fix
a-r-r-o-w
left a comment
There was a problem hiding this comment.
Thank you for working on this, looks good to me! I think we can merge this once you add your name and contrib to the community README file. Also, seems like at place of the code, the style guide is not followed. Normally, these could be fixed with make style if it was a pipeline in core diffusers. However, since this is a community pipeline, you can run styling with:ruff check examples/community/pipeline_hunyuandit_differential_img2img.py --fix
MnCSSJ4x
commented
Aug 3, 2024
@a-r-r-o-w I have fixed the style issues and added the details to the markdown file. If all looks good, you can go ahead and merge this request. |
a-r-r-o-w
commented
Aug 3, 2024
@MnCSSJ4x Could you revert all the other changes apart from adding your name and contribution to community README? If you'd like to refactor, you can do it in a separate PR as it's out of scope for this one. Please keep the changes here limited |
MnCSSJ4x
commented
Aug 3, 2024
Sure. I'll try to revert in fix. I feel some tool might have auto refactored it. |
@a-r-r-o-w Can you please check and let me know if it's ok now? Apologies for bothering you with such trivial issues. |
MnCSSJ4x
commented
Aug 3, 2024
@a-r-r-o-w Thanks for the command. It should be resolved now. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
a-r-r-o-w
commented
Aug 3, 2024
@MnCSSJ4x Looking good implementation-wise. The quality tests seems to be failing. Could you run |
HuggingFaceDocBuilderDev
commented
Aug 3, 2024
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. |
MnCSSJ4x
commented
Aug 3, 2024
Upon running ruffcheckexamplesscriptssrctestsutilsbenchmarkssetup.py--fixsrc/diffusers/configuration_utils.py:679:16: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|677|iffield.nameinself._flax_internal_args:
678|continue679|if type(field.default) ==dataclasses._MISSING_TYPE:
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^E721680|default_kwargs[field.name] =None681|else:
|tests/models/test_modeling_common.py:338:20: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|337|model.set_default_attn_processor()
338|assertall(type(proc) ==AttnProcessorNPUforprocinmodel.attn_processors.values())
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^E721339|withtorch.no_grad():
340|ifself.forward_requires_fresh_args:
|tests/models/test_modeling_common.py:346:20: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|345|model.enable_npu_flash_attention()
346|assertall(type(proc) ==AttnProcessorNPUforprocinmodel.attn_processors.values())
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^E721347|withtorch.no_grad():
348|ifself.forward_requires_fresh_args:
|tests/models/test_modeling_common.py:354:20: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|353|model.set_attn_processor(AttnProcessorNPU())
354|assertall(type(proc) ==AttnProcessorNPUforprocinmodel.attn_processors.values())
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^E721355|withtorch.no_grad():
356|ifself.forward_requires_fresh_args:
|tests/models/test_modeling_common.py:389:20: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|388|model.set_default_attn_processor()
389|assertall(type(proc) ==AttnProcessorforprocinmodel.attn_processors.values())
|^^^^^^^^^^^^^^^^^^^^^^^^^^^E721390|withtorch.no_grad():
391|ifself.forward_requires_fresh_args:
|tests/models/test_modeling_common.py:397:20: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|396|model.enable_xformers_memory_efficient_attention()
397|assertall(type(proc) ==XFormersAttnProcessorforprocinmodel.attn_processors.values())
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^E721398|withtorch.no_grad():
399|ifself.forward_requires_fresh_args:
|tests/models/test_modeling_common.py:405:20: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|404|model.set_attn_processor(XFormersAttnProcessor())
405|assertall(type(proc) ==XFormersAttnProcessorforprocinmodel.attn_processors.values())
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^E721406|withtorch.no_grad():
407|ifself.forward_requires_fresh_args:
|tests/models/test_modeling_common.py:433:20: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|431|return432|433|assertall(type(proc) ==AttnProcessor2_0forprocinmodel.attn_processors.values())
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^E721434|withtorch.no_grad():
435|ifself.forward_requires_fresh_args:
|tests/models/test_modeling_common.py:441:20: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|440|model.set_default_attn_processor()
441|assertall(type(proc) ==AttnProcessorforprocinmodel.attn_processors.values())
|^^^^^^^^^^^^^^^^^^^^^^^^^^^E721442|withtorch.no_grad():
443|ifself.forward_requires_fresh_args:
|tests/models/test_modeling_common.py:449:20: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|448|model.set_attn_processor(AttnProcessor2_0())
449|assertall(type(proc) ==AttnProcessor2_0forprocinmodel.attn_processors.values())
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^E721450|withtorch.no_grad():
451|ifself.forward_requires_fresh_args:
|tests/models/test_modeling_common.py:457:20: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|456|model.set_attn_processor(AttnProcessor())
457|assertall(type(proc) ==AttnProcessorforprocinmodel.attn_processors.values())
|^^^^^^^^^^^^^^^^^^^^^^^^^^^E721458|withtorch.no_grad():
459|ifself.forward_requires_fresh_args:
|tests/pipelines/controlnet/test_controlnet_sdxl.py:1022:16: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|1021|controlnet=ControlNetModel.from_unet(unet, conditioning_channels=4)
1022|asserttype(controlnet.mid_block) ==UNetMidBlock2D|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^E7211023|assertcontrolnet.conditioning_channels==4|tests/pipelines/test_pipelines_common.py:777:21: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|775|ifhasattr(component, "attn_processors"):
776|assertall(
777|type(proc) ==AttnProcessorforprocincomponent.attn_processors.values()
|^^^^^^^^^^^^^^^^^^^^^^^^^^^E721778| ), "`from_pipe` changed the attention processor in original pipeline."|tests/schedulers/test_schedulers.py:827:16: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|825|scheduler_loaded=DDIMScheduler.from_pretrained(f"{USER}/{self.repo_id}")
826|827|asserttype(scheduler) ==type(scheduler_loaded)
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^E721828|829|# Reset repo|tests/schedulers/test_schedulers.py:838:16: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|836|scheduler_loaded=DDIMScheduler.from_pretrained(f"{USER}/{self.repo_id}")
837|838|asserttype(scheduler) ==type(scheduler_loaded)
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^E721839|840|# Reset repo|tests/schedulers/test_schedulers.py:854:16: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|852|scheduler_loaded=DDIMScheduler.from_pretrained(self.org_repo_id)
853|854|asserttype(scheduler) ==type(scheduler_loaded)
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^E721855|856|# Reset repo|tests/schedulers/test_schedulers.py:865:16: E721Use`is`and`is not`fortypecomparisons, or`isinstance()`forisinstancechecks|863|scheduler_loaded=DDIMScheduler.from_pretrained(self.org_repo_id)
864|865|asserttype(scheduler) ==type(scheduler_loaded)
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^E721866|867|# Reset repo|Found17errors.
make: *** [style] Error1 |
a-r-r-o-w
commented
Aug 3, 2024
Is your ruff version same as the one in our setup.py? I remember seeing something in the past due to incompatible ruff versions |
MnCSSJ4x
commented
Aug 5, 2024
Hi, yes the version was different. Fixed it and ran the command However, Got some error text |
a-r-r-o-w
left a comment
There was a problem hiding this comment.
Thank you for your contribution and bearing with our reviews! This is a very strong good-first-issue finish 🎉
* Add Differential Pipeline. * Fix Styling Issue using ruff -fix * Add details to Contributing.md * Revert "Fix Styling Issue using ruff -fix" This reverts commit d347de1. * Revert "Revert "Fix Styling Issue using ruff -fix"" This reverts commit ce7c3ff. * Revert README changes * Restore README.md * Update README.md * Resolved Comments: * Fix Readme based on review * Fix formatting after make style --------- Co-authored-by: Aryan <aryan@huggingface.co>

What does this PR do?
Adds Differential Diffusion to HunyuanDIT.
Fixes Partially #8924(HunyuanDiT Only)
Before submitting
How to test:
Gradient
A colab notebook demonstrating all results can be found here. Depth Maps have also been added in the same colab.
Who can review?
@a-r-r-o-w@DN6