Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2024-11-08 08:53:42 -05:00
parent e06ee1008a
commit 34d6d5f92b
3 changed files with 6 additions and 5 deletions
+4 -3
View File
@@ -167,13 +167,14 @@ class PromptEmbedder:
pipe = prepare_model()
def __call__(self, key, step=0):
batch = getattr(self, key)
batch = getattr(self, key) # for batch-size=1, len(batch)==1
res = []
for i in range(self.batchsize):
if len(batch[i]) == 0:
if len(batch[i]) == 0: # if not using prompt-scheduling, this will be len(batch[i])==1
return None
else:
res.append(batch[i][step])
# causes error in callback
res.append(batch[i][step]) # and this requests element for specific step when called from callback - but self.scheduled_prompt==False so len(batch[i])==1 and step is list index out-of-bounds!
if step != 0: # For Callback
res.append(batch[i][step]) # Diffusers internally doubles batch dimension
return torch.cat(res)
+1 -1
Submodule wiki updated: 2dba58a696...47ea50e915