Skip to content

Instantly share code, notes, and snippets.

@takuma104
Last active February 23, 2023 18:04
Show Gist options
  • Save takuma104/ce954bde6511a1f0b031a87a646b1f7d to your computer and use it in GitHub Desktop.
Save takuma104/ce954bde6511a1f0b031a87a646b1f7d to your computer and use it in GitHub Desktop.
import torch
from diffusers import UNet2DConditionModel
mem_bytes = torch.cuda.max_memory_allocated()
torch.cuda.reset_peak_memory_stats()
controlnet = UNet2DConditionModel.from_pretrained("takuma104/control_sd15_canny", subfolder="controlnet").cuda()
mem_bytes = torch.cuda.max_memory_allocated()
print(mem_bytes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment