Skip to content

Conversation

@sayakpaul
Copy link
Member

What does this PR do?

The tests also helped me uncover some bugs and fix them. Some comments are in line.

InputParam(
"guidance",
required=True,
required=False,
Copy link
Member Author

Choose a reason for hiding this comment

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

For Flux.1-schnell, guidance shouldn't be required.

"image_processor",
VaeImageProcessor,
config=FrozenDict({"vae_scale_factor": 16}),
config=FrozenDict({"vae_scale_factor": 16, "vae_latent_channels": 16}),
Copy link
Member Author

Choose a reason for hiding this comment

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

Just to be consistent.

Comment on lines +115 to +118
pooled_prompt_embeds = block_state.pooled_prompt_embeds.repeat(1, block_state.num_images_per_prompt)
block_state.pooled_prompt_embeds = pooled_prompt_embeds.view(
block_state.batch_size * block_state.num_images_per_prompt, -1
)
Copy link
Member Author

Choose a reason for hiding this comment

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

Was left out of the expansion incorrectly.

import torch
from PIL import Image

from diffusers import (
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated changes but I thought I would do it (happy to revert).

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

@sayakpaul sayakpaul requested a review from yiyixuxu November 1, 2025 01:30
Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

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

thanks for the PR
looks good, but I don't know why the changes in components_manager got reverted
I left a commenet there, I think we should add a warning during enable_model_oaffload(), and you can also keep the warning from the memory_reserve (or just make a note there in comment so we know that to fix in the fugure)

feel free to merge otherwise

device_module = getattr(torch, device_type, torch.cuda)
mem_on_device = device_module.mem_get_info(execution_device.index)[0]
mem_on_device = mem_on_device - self.memory_reserve_margin

Copy link
Collaborator

Choose a reason for hiding this comment

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

ohh, what happended here?
#12566 (comment)
It was a good catch, I think we should also add a warning sooner during enable_model_offload()

Copy link
Member Author

Choose a reason for hiding this comment

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

My bad for misunderstanding!

I have added the error catching. I added a TODO in enable_auto_cpu_offload() to error out early for mem_get_info().

@sayakpaul sayakpaul merged commit 8f80dda into main Nov 2, 2025
17 of 18 checks passed
@sayakpaul sayakpaul deleted the flux-modular-tests branch November 2, 2025 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants