Skip to content
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

Add Learned PE selection for Auraflow #9182

Merged
merged 5 commits into from
Aug 15, 2024

Conversation

cloneofsimo
Copy link
Contributor

What does this PR do?

Adds simple Positional Embedding selection logic to have width, height of variable length. This is for auraflow v0.3

@cloneofsimo
Copy link
Contributor Author

from diffusers import AuraFlowPipeline
import torch

pipeline = AuraFlowPipeline.from_pretrained(
    "/home/ubuntu/auraflow_converter/afv3",
    torch_dtype=torch.float16,
    use_safetensors=True,
    variant="fp16", 
).to("cuda")

image = pipeline(
    prompt="rempage of the iguana character riding F1, fast and furious, cinematic movie poster",
    width=1536,
    height=768,
    num_inference_steps=50, 
    generator=torch.Generator().manual_seed(1),
    guidance_scale=3.5,
).images[0]

# save
image.save("image.png")

image

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor comments but LGTM, thanks!

@HuggingFaceDocBuilderDev

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.

@DN6
Copy link
Collaborator

DN6 commented Aug 15, 2024

Change looks good to me. @cloneofsimo could please you run make style && make quality so the QC checks pass.

@sayakpaul sayakpaul merged commit 1a92bc0 into huggingface:main Aug 15, 2024
15 checks passed
@sayakpaul
Copy link
Member

Thank you! Excited to ship!

yiyixuxu pushed a commit that referenced this pull request Aug 24, 2024
* add pe

* Update src/diffusers/models/transformers/auraflow_transformer_2d.py

Co-authored-by: Sayak Paul <[email protected]>

* Update src/diffusers/models/transformers/auraflow_transformer_2d.py

* beauty

* retrigger ci.

---------

Co-authored-by: Sayak Paul <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants