Skip to content

Commit

Permalink
VRAM optimization: the accelerator move needs to happen before the SD…
Browse files Browse the repository at this point in the history
…XL refiner runs

Signed-off-by: bghira <[email protected]>
  • Loading branch information
bghira committed Jul 8, 2023
1 parent a77a71c commit 906aa82
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 @@ -251,15 +251,15 @@ def _run_pipeline(
generator=generator,
guidance_rescale=user_config.get('guidance_rescale', 0.3),
).images
# Unload the primary pipeline before ControlNet.
self.pipeline_manager.to_cpu(pipe)
if use_latent_result:
preprocessed_images = self._refiner_pipeline(
images=preprocessed_images,
user_config=user_config,
prompt=positive_prompt,
negative_prompt=negative_prompt,
)
# Unload the primary pipeline before ControlNet.
self.pipeline_manager.to_cpu(pipe)
new_image = self._controlnet_all_images(preprocessed_images=preprocessed_images, user_config=user_config, generator=generator)
elif not upscaler and not promptless_variation and image is not None:
# Img2Img workflow
Expand Down

0 comments on commit 906aa82

Please sign in to comment.