sd-webui-controlnet
sd-webui-controlnet copied to clipboard
[Bug]: Clip_vision preprocessor unnecessary memory usage/leak
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits of both this extension and the webui
What happened?
/clip/init.py file should use torch.no_grad()
with torch.no_grad():
clip_vision_model = clip_vision_model.to(devices.get_device_for("controlnet"))
style_for_clip = clip_proc(images=img, return_tensors="pt")['pixel_values']
style_feat = clip_vision_model(style_for_clip.to(devices.get_device_for("controlnet")))['last_hidden_state']
without it I had to use --lowvram, now works fine.
Steps to reproduce the problem
- Go to ....
- Press ....
- ...
What should have happened?
...
Commit where the problem happens
webui: controlnet: .
What browsers do you use to access the UI ?
Mozilla Firefox
Command Line Arguments
..
Console logs
...
Additional information
No response