Skip to content

Conversation

@sayakpaul
Copy link
Member

What does this PR do?

Don't review yet.

Comment on lines +654 to +662
vae_scale_factor = components.vae_scale_factor
block_state.img_shapes = [
[
(1, block_state.height // vae_scale_factor // 2, block_state.width // vae_scale_factor // 2),
*[
(1, vae_height // vae_scale_factor // 2, vae_width // vae_scale_factor // 2)
for vae_width, vae_height in block_state.vae_image_sizes
],
]
Copy link
Member Author

Choose a reason for hiding this comment

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

Main difference from the existing RoPE block for Edit.

Comment on lines +885 to +893
vae_image_sizes = []
for img in block_state.vae_image:
width, height = img.size
vae_width, vae_height, _ = calculate_dimensions(self.vae_image_size, width / height)
vae_image_sizes.append((vae_width, vae_height))
processed_images.append(
components.image_processor.preprocess(image=img, height=vae_height, width=vae_width)
)
block_state.processed_image = torch.stack(processed_images, dim=0).squeeze(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.

Each input image can have a different resolution and that is why separate preprocess is needed (also following the original implementation). This came into fruition because we started testing with multiple input images.

Comment on lines +349 to +351
if self.reshape_to_seq_dim:
channels = image_latent_tensor.shape[-1]
image_latent_tensor = image_latent_tensor.reshape(1, -1, channels)
Copy link
Member Author

Choose a reason for hiding this comment

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

Qwen Image Edit Plus specific.

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

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.

3 participants