mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-20 15:32:32 +08:00
Edge case fixes
This commit is contained in:
parent
4ba28caa8c
commit
0c7b5addba
@ -1640,7 +1640,6 @@ class SAM31Tracker(nn.Module):
|
||||
output_dict = {"cond_frame_outputs": {}, "non_cond_frame_outputs": {}}
|
||||
all_masks = []
|
||||
idev = comfy.model_management.intermediate_device()
|
||||
empty = lambda: torch.zeros(0, self.image_size, self.image_size, device=idev, dtype=dt)
|
||||
mux_state = None
|
||||
if initial_masks is not None:
|
||||
mux_state = MultiplexState(initial_masks.shape[0], self.num_multiplex, device, dt)
|
||||
@ -1710,7 +1709,7 @@ class SAM31Tracker(nn.Module):
|
||||
for i in range(mux_state.total_valid_entries):
|
||||
keep_alive[i] = 1
|
||||
else:
|
||||
all_masks.append(empty())
|
||||
all_masks.append(None)
|
||||
if pbar is not None:
|
||||
pbar.update(1)
|
||||
# Skip to backbone advance at end of loop
|
||||
|
||||
@ -50,7 +50,7 @@ class SAM3TokenizerWrapper(sd1_clip.SD1Tokenizer):
|
||||
|
||||
def tokenize_with_weights(self, text: str, return_word_ids=False, **kwargs):
|
||||
parsed = _parse_prompts(text)
|
||||
if len(parsed) <= 1 and parsed[0][1] == 1:
|
||||
if len(parsed) <= 1 and (not parsed or parsed[0][1] == 1):
|
||||
return super().tokenize_with_weights(text, return_word_ids, **kwargs)
|
||||
# Tokenize each prompt part separately, store per-part batches and metadata
|
||||
inner = getattr(self, self.clip)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user