old python version compat
This commit is contained in:
parent
ab500dd288
commit
87ca894694
|
@ -224,11 +224,8 @@ class StableDiffusionHolder:
|
||||||
precision_scope = autocast if self.precision == "autocast" else nullcontext
|
precision_scope = autocast if self.precision == "autocast" else nullcontext
|
||||||
generator = torch.Generator(device=self.device).manual_seed(int(self.seed))
|
generator = torch.Generator(device=self.device).manual_seed(int(self.seed))
|
||||||
|
|
||||||
with (
|
with precision_scope("cuda"):
|
||||||
precision_scope("cuda"),
|
with self.model.ema_scope():
|
||||||
self.model.ema_scope(),
|
|
||||||
):
|
|
||||||
|
|
||||||
if self.guidance_scale != 1.0:
|
if self.guidance_scale != 1.0:
|
||||||
uc = self.model.get_learned_conditioning([""])
|
uc = self.model.get_learned_conditioning([""])
|
||||||
else:
|
else:
|
||||||
|
@ -318,10 +315,8 @@ class StableDiffusionHolder:
|
||||||
precision_scope = autocast if self.precision == "autocast" else nullcontext
|
precision_scope = autocast if self.precision == "autocast" else nullcontext
|
||||||
generator = torch.Generator(device=self.device).manual_seed(int(self.seed))
|
generator = torch.Generator(device=self.device).manual_seed(int(self.seed))
|
||||||
|
|
||||||
with (
|
with precision_scope("cuda"):
|
||||||
precision_scope("cuda"),
|
with self.model.ema_scope():
|
||||||
self.model.ema_scope(),
|
|
||||||
):
|
|
||||||
|
|
||||||
batch = make_batch_sd(self.image_source, self.mask_image, txt="willbereplaced", device=self.device, num_samples=1)
|
batch = make_batch_sd(self.image_source, self.mask_image, txt="willbereplaced", device=self.device, num_samples=1)
|
||||||
c = text_embeddings
|
c = text_embeddings
|
||||||
|
|
Loading…
Reference in New Issue