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