Skip to content

Conversation

@huchenlei
Copy link
Contributor

Based on #5987

This PR enforces F841 (Unused variable).

self.control_model.to(comfy.model_management.get_torch_device())
diffusion_model = model.diffusion_model
sd = diffusion_model.state_dict()
cm = self.control_model.state_dict()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should improve performance as state_dict is an expensive call.

# self.dropout = nn.Dropout(config.dropout_rate)

def forward(self, x, mask=None, past_bias=None, optimized_attention=None):
normed_hidden_states = self.layer_norm(x)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Avoided duplicated call to self.layer_norm(x)

@comfyanonymous comfyanonymous added the Run-CI-Test This is an administrative label to tell the CI to run full automatic testing on this PR now. label Dec 11, 2024
@github-actions
Copy link
Contributor

(Automated Bot Message) CI Tests are running, you can view the results at https://ci.comfy.org/?branch=5989%2Fmerge

@comfyanonymous comfyanonymous merged commit d9d7f3c into master Dec 12, 2024
15 of 19 checks passed
@comfyanonymous comfyanonymous deleted the unused_var branch December 12, 2024 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Run-CI-Test This is an administrative label to tell the CI to run full automatic testing on this PR now.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants