Skip to content

Conversation

@yiyixuxu
Copy link
Collaborator

No description provided.

@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.

@chengzeyi
Copy link
Contributor

Code to reproduce:

# diffusers 2c1ed50fc57f154768364e4506d7bab9daebf83d
# torch 2.5.0
# Recompilation caused by calling torch.nn.functional.rms_norm(), which calls aten.size instead of aten.sym_size

import os

os.environ["TORCH_LOGS"] = "recompiles,dynamic"

import torch
from diffusers import FluxPipeline

pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
pipe.transformer = torch.compile(pipe.transformer, dynamic=True, backend="eager")

prompt = "A cat holding a sign that says hello world"

for height, width in [(1536, 1024), (1024, 512)]:
    image = pipe(
        prompt,
        height=1024,
        width=1024,
        guidance_scale=3.5,
        num_inference_steps=50,
        max_sequence_length=512,
        generator=torch.Generator("cpu").manual_seed(0)
    ).images[0]
    image.save(f"flux-dev_{height}x{width}.png")

@yiyixuxu yiyixuxu merged commit e9fda39 into main Mar 20, 2025
14 of 15 checks passed
@yiyixuxu yiyixuxu deleted the remove_rms_norm branch March 20, 2025 17:55
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.

4 participants