From cf28445f10e4a6b6fbc9456d45128f163f66f764 Mon Sep 17 00:00:00 2001 From: C43H66N12O12S2 <36072735+C43H66N12O12S2@users.noreply.github.com> Date: Mon, 19 Sep 2022 18:18:33 +0300 Subject: [PATCH] fix cpu usage --- modules/prompt_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/prompt_parser.py b/modules/prompt_parser.py index 0835f692..67a4683a 100644 --- a/modules/prompt_parser.py +++ b/modules/prompt_parser.py @@ -114,7 +114,7 @@ def get_learned_conditioning(prompts, steps): def reconstruct_cond_batch(c: ScheduledPromptBatch, current_step): - res = torch.zeros(c.shape) + res = torch.zeros(c.shape, device=shared.device, dtype=torch.half) for i, cond_schedule in enumerate(c.schedules): target_index = 0 for curret_index, (end_at, cond) in enumerate(cond_schedule): @@ -123,7 +123,7 @@ def reconstruct_cond_batch(c: ScheduledPromptBatch, current_step): break res[i] = cond_schedule[target_index].cond - return res.to(shared.device) + return res