Skip to content

Commit

Permalink
Ensure refiner is not None when loading in prompt_to_image (#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
carson-katri authored Oct 27, 2023
1 parent ec97a96 commit e515cca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion generator_process/actions/prompt_to_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def prompt_to_image(
device = self.choose_device(optimizations)

# Stable Diffusion pipeline w/ caching
if device == "cuda" and (optimizations.cpu_offloading(device) or torch.cuda.mem_get_info()[1] > 20 * 1024**3 * (1 if optimizations.can_use_half(device) else 2)):
if sdxl_refiner_model is not None and device == "cuda" and (optimizations.cpu_offloading(device) or torch.cuda.mem_get_info()[1] > 20 * 1024**3 * (1 if optimizations.can_use_half(device) else 2)):
pipe, refiner = self.load_model(diffusers.AutoPipelineForText2Image, model, optimizations, scheduler, sdxl_refiner_model=sdxl_refiner_model)
else:
pipe = self.load_model(diffusers.AutoPipelineForText2Image, model, optimizations, scheduler)
Expand Down

0 comments on commit e515cca

Please sign in to comment.