Skip to content

Fix SanaCombinedTimestepGuidanceEmbeddings to handle missing guidance#13109

Open
Mr-Neutr0n wants to merge 1 commit intohuggingface:mainfrom
Mr-Neutr0n:fix-sana-guidance-embeddings
Open

Fix SanaCombinedTimestepGuidanceEmbeddings to handle missing guidance#13109
Mr-Neutr0n wants to merge 1 commit intohuggingface:mainfrom
Mr-Neutr0n:fix-sana-guidance-embeddings

Conversation

@Mr-Neutr0n
Copy link

Summary

  • Fix SanaCombinedTimestepGuidanceEmbeddings.forward() to handle the case where guidance is None
  • When guidance_embeds=True but guidance is not provided at inference time, the forward call would crash trying to project None through the guidance condition projector
  • Default to ones_like(timestep) when guidance is not provided
  • Accept **kwargs for forward compatibility with callers that pass batch_size

Fixes #12540

Test plan

  • Verify SanaPipeline inference works with guidance_embeds=True and no guidance provided
  • Verify no regression when guidance is provided normally

When guidance_embeds=True but guidance is not provided at inference
time, SanaCombinedTimestepGuidanceEmbeddings.forward() would crash
because it tried to project None through the guidance condition
projector.

Default to ones_like(timestep) when guidance is None, and accept
**kwargs for forward compatibility with callers that pass batch_size.
@Mr-Neutr0n
Copy link
Author

Friendly bump! Let me know if there's anything I should update or improve to help move this forward.

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.

SanaCombinedTimestepGuidanceEmbeddings do not work with SanaPipeline

1 participant