Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace print with logging #6138

Merged
merged 7 commits into from
Dec 20, 2024
Merged

Replace print with logging #6138

merged 7 commits into from
Dec 20, 2024

Conversation

huchenlei
Copy link
Collaborator

This PR enforces ruff lint rule T201 that bans usage of print. All existing usage of print in core are replaced with logging. All usages in tests/deployment files are annotated with # noqa.

robinjhuang
robinjhuang previously approved these changes Dec 20, 2024
webfiltered
webfiltered previously approved these changes Dec 20, 2024
comfy/ldm/aura/mmdit.py Show resolved Hide resolved
@huchenlei huchenlei dismissed stale reviews from webfiltered and robinjhuang via 34eced3 December 20, 2024 20:46
@@ -754,7 +754,6 @@ def concat_cond(self, **kwargs):
mask = torch.ones_like(noise)[:, :1]

mask = torch.mean(mask, dim=1, keepdim=True)
print(mask.shape)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cleanup debug logs.

@@ -160,7 +160,6 @@ def __init__(
if isinstance(self.num_classes, int):
self.label_emb = nn.Embedding(num_classes, time_embed_dim)
elif self.num_classes == "continuous":
print("setting up linear c_adm embedding layer")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cleanup debug logs.

@@ -518,7 +519,6 @@ def multistep_uni_pc_vary_update(self, x, model_prev_list, t_prev_list, t, order
A_p = C_inv_p

if use_corrector:
print('using corrector')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cleanup debug logs.

@@ -41,8 +41,7 @@ def encode_token_weights(self, token_weight_pairs):
to_encode.append(self.gen_empty_tokens(self.special_tokens, max_token_len))
else:
to_encode.append(gen_empty_tokens(self.special_tokens, max_token_len))
print(to_encode)
Copy link
Collaborator Author

@huchenlei huchenlei Dec 20, 2024

Choose a reason for hiding this comment

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

Cleanup debugging print added in #6055.

@comfyanonymous comfyanonymous merged commit d7969cb into master Dec 20, 2024
6 checks passed
@comfyanonymous comfyanonymous deleted the replace_print branch December 20, 2024 21:24
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