diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

PAG is now supported in core 🤗

Open sayakpaul opened this issue 1 year ago • 6 comments

Hello folks!

https://github.com/huggingface/diffusers/pull/7944/ introduced support for Perturbed Attention Guidance (PAG) which enhances image generation quality training-free.

Generated Image without PAG Generated Image with PAG
Image without PAG Image with PAG

Check out the PAG guide here: https://huggingface.co/docs/diffusers/main/en/using-diffusers/pag.

Please treat this issue as an announcement instead. Report issues separately.

sayakpaul avatar Jun 26 '24 05:06 sayakpaul

/usr/local/lib/python3.10/dist-packages/diffusers/pipelines/auto_pipeline.py in _get_task_class(mapping, pipeline_class_name, throw_error_if_not_exist) 183 184 if throw_error_if_not_exist: --> 185 raise ValueError(f"AutoPipeline can't find a pipeline linked to {pipeline_class_name} for {model_name}") 186 187

ValueError: AutoPipeline can't find a pipeline linked to StableDiffusionPAGPipeline for None

s9anus98a avatar Jun 26 '24 18:06 s9anus98a

@s9anus98a can you open an issue and share the code you used?

yiyixuxu avatar Jun 26 '24 18:06 yiyixuxu

@s9anus98a can you open an issue and share the code you used?

i use AutoPipelineForText2Image like in the example link provided

!pip install diffusers


self.pipeline = AutoPipelineForText2Image.from_pretrained(
            model_key,
            torch_dtype=self.dtype,
            enable_pag=True,
            pag_applied_layers=["mid"],  # You can adjust this as needed
        ).to(self.device)

s9anus98a avatar Jun 27 '24 07:06 s9anus98a

Please create a new issue for this.

sayakpaul avatar Jun 27 '24 07:06 sayakpaul

@s9anus98a

pip install git+https://github.com/huggingface/diffusers

crapthings avatar Jul 11 '24 12:07 crapthings

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Sep 14 '24 15:09 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Nov 09 '24 15:11 github-actions[bot]