Skip to content

Commit

Permalink
Update stableDiffusion.py
Browse files Browse the repository at this point in the history
  • Loading branch information
soten355 committed Aug 5, 2023
1 parent 8e1b752 commit 767f8a3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions stableDiffusionDiffusers/stableDiffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,9 @@ def compileModels(
torch_dtype = self.dtype,
safety_checker = None
)

self.pipeline.enable_model_cpu_offload(gpu_id = self.torchDevice)

## To be fully implemented with HuggingFace updates their code for my request
# self.pipeline.enable_model_cpu_offload(gpu_id = self.torchDevice)

if self.VAE != None:
print("...using",self.VAE,"as VAE...")
Expand Down Expand Up @@ -662,4 +663,4 @@ def clearMemory():
for image in images:
location = "stableDiffusionDiffusers/final0000"+str(seed)+".png"
image.save(location)
i += 1
i += 1

0 comments on commit 767f8a3

Please sign in to comment.