Skip to content

Commit

Permalink
VRAM: Generator to CPU
Browse files Browse the repository at this point in the history
Signed-off-by: bghira <[email protected]>
  • Loading branch information
bghira committed Jul 8, 2023
1 parent c477f27 commit f115230
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discord_tron_client/classes/image_manipulation/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def _get_generator(self, user_config: dict):
self.seed = int(self.seed) + random.randint(-5, 5)
elif int(self.seed) < 0:
self.seed = random.randint(0, 2**32)
generator = torch.Generator(device=self.pipeline_manager.device)
generator = torch.Generator(device="cpu")
generator.manual_seed(int(self.seed))
logging.info(f"Seed: {self.seed}")
return generator
Expand Down Expand Up @@ -478,7 +478,7 @@ def _refiner_pipeline(self, images: Image, user_config: dict, prompt: str = None
# Get a random int:
seed = random.randint(0, 2**32)
new_images.append(pipe(
generator = torch.Generator().manual_seed(int(seed)),
generator = torch.Generator(device="cpu").manual_seed(int(seed)),
prompt=prompt,
negative_prompt=negative_prompt,
image=image,
Expand Down

0 comments on commit f115230

Please sign in to comment.