Commit cf28445f authored by C43H66N12O12S2's avatar C43H66N12O12S2 Committed by AUTOMATIC1111

fix cpu usage

parent 422d1748
...@@ -114,7 +114,7 @@ def get_learned_conditioning(prompts, steps): ...@@ -114,7 +114,7 @@ def get_learned_conditioning(prompts, steps):
def reconstruct_cond_batch(c: ScheduledPromptBatch, current_step): 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): for i, cond_schedule in enumerate(c.schedules):
target_index = 0 target_index = 0
for curret_index, (end_at, cond) in enumerate(cond_schedule): for curret_index, (end_at, cond) in enumerate(cond_schedule):
...@@ -123,7 +123,7 @@ def reconstruct_cond_batch(c: ScheduledPromptBatch, current_step): ...@@ -123,7 +123,7 @@ def reconstruct_cond_batch(c: ScheduledPromptBatch, current_step):
break break
res[i] = cond_schedule[target_index].cond res[i] = cond_schedule[target_index].cond
return res.to(shared.device) return res
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment