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

Fixes and improvement when using xformers. #4

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

madrang
Copy link

@madrang madrang commented Dec 26, 2022

No description provided.

@@ -144,9 +144,8 @@ def __init__(self, arch="ViT-H-14", version="laion2b_s32b_b79k", device="cuda",
freeze=True, layer="last"):
super().__init__()
assert layer in self.LAYERS
model, _, _ = open_clip.create_model_and_transforms(arch, device=torch.device('cpu'), pretrained=version)
Copy link

Choose a reason for hiding this comment

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

Is this just a cosmetic change (to remove unused variables), or this this needed for any functional changes?

I'd avoid too much divergence from the stability codebase, even if we don't really agree with the coding style. Ideally I would not have a custom fork at all.

Copy link
Author

@madrang madrang Dec 26, 2022

Choose a reason for hiding this comment

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

create_model_and_transforms loads and create image transforms for img2img but they don't use them.
It's faster to just call create_model and only process the part that is needed.
That change is already in a PR waiting to be merged Stability-AI#52

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.

2 participants