mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-07-12 09:27:15 +08:00
Sync branch with master and resolve conflicts in comfy/sd1_clip.py
This commit is contained in:
commit
7605b998a4
@ -171,6 +171,9 @@
|
|||||||
- Reuse existing model classes, blocks, ops, and helper modules when appropriate.
|
- Reuse existing model classes, blocks, ops, and helper modules when appropriate.
|
||||||
Before implementing a new version of a model component, search the existing
|
Before implementing a new version of a model component, search the existing
|
||||||
model code for a class or helper that already provides the behavior.
|
model code for a class or helper that already provides the behavior.
|
||||||
|
- Model detection code that inspects linear weight shapes should only use the
|
||||||
|
first dimension. The second dimension may be half the original size for
|
||||||
|
NVFP4 or other 4-bit quantized models.
|
||||||
- Avoid adding `einops` usage in core inference code. Use native torch tensor
|
- Avoid adding `einops` usage in core inference code. Use native torch tensor
|
||||||
ops such as `reshape`, `view`, `permute`, `transpose`, `flatten`, `unflatten`,
|
ops such as `reshape`, `view`, `permute`, `transpose`, `flatten`, `unflatten`,
|
||||||
`unsqueeze`, and `squeeze` instead.
|
`unsqueeze`, and `squeeze` instead.
|
||||||
|
|||||||
@ -551,18 +551,24 @@ class SDTokenizer:
|
|||||||
def _try_get_embedding(self, embedding_name:str):
|
def _try_get_embedding(self, embedding_name:str):
|
||||||
'''
|
'''
|
||||||
Takes a potential embedding name and tries to retrieve it.
|
Takes a potential embedding name and tries to retrieve it.
|
||||||
Returns a Tuple consisting of the embedding and any leftover string, embedding can be None.
|
Returns a Tuple consisting of the embedding, the cleaned embedding name, and any leftover string, embedding can be None.
|
||||||
'''
|
'''
|
||||||
split_embed = embedding_name.split()
|
split_embed = embedding_name.split()
|
||||||
embedding_name = split_embed[0]
|
embedding_name = split_embed[0]
|
||||||
leftover = ' '.join(split_embed[1:])
|
leftover = ' '.join(split_embed[1:])
|
||||||
|
|
||||||
|
match = re.search(r'[<\[]', embedding_name)
|
||||||
|
if match is not None:
|
||||||
|
leftover = embedding_name[match.start():] + (" " + leftover if leftover else "")
|
||||||
|
embedding_name = embedding_name[:match.start()]
|
||||||
|
|
||||||
embed = load_embed(embedding_name, self.embedding_directory, self.embedding_size, self.embedding_key)
|
embed = load_embed(embedding_name, self.embedding_directory, self.embedding_size, self.embedding_key)
|
||||||
if embed is None:
|
if embed is None:
|
||||||
stripped = embedding_name.strip(',')
|
stripped = embedding_name.strip(',')
|
||||||
if len(stripped) < len(embedding_name):
|
if len(stripped) < len(embedding_name):
|
||||||
embed = load_embed(stripped, self.embedding_directory, self.embedding_size, self.embedding_key)
|
embed = load_embed(stripped, self.embedding_directory, self.embedding_size, self.embedding_key)
|
||||||
return (embed, "{} {}".format(embedding_name[len(stripped):], leftover))
|
return (embed, embedding_name, "{} {}".format(embedding_name[len(stripped):], leftover))
|
||||||
return (embed, leftover)
|
return (embed, embedding_name, leftover)
|
||||||
|
|
||||||
def pad_tokens(self, tokens, amount):
|
def pad_tokens(self, tokens, amount):
|
||||||
if self.pad_left:
|
if self.pad_left:
|
||||||
@ -611,7 +617,7 @@ class SDTokenizer:
|
|||||||
|
|
||||||
if matched_id is not None and self.embedding_directory is not None:
|
if matched_id is not None and self.embedding_directory is not None:
|
||||||
embedding_name = word[len(matched_id):].strip('\n')
|
embedding_name = word[len(matched_id):].strip('\n')
|
||||||
embed, leftover = self._try_get_embedding(embedding_name)
|
embed, embedding_name, leftover = self._try_get_embedding(embedding_name)
|
||||||
if embed is None:
|
if embed is None:
|
||||||
logging.warning(f"warning, embedding:{embedding_name} does not exist, ignoring")
|
logging.warning(f"warning, embedding:{embedding_name} does not exist, ignoring")
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -2611,7 +2611,7 @@ class ByteDanceSeedAudioNode(IO.ComfyNode):
|
|||||||
return IO.Schema(
|
return IO.Schema(
|
||||||
node_id="ByteDanceSeedAudio",
|
node_id="ByteDanceSeedAudio",
|
||||||
display_name="ByteDance Seed Audio 1.0",
|
display_name="ByteDance Seed Audio 1.0",
|
||||||
category="api node/audio/ByteDance",
|
category="partner/audio/ByteDance",
|
||||||
description=(
|
description=(
|
||||||
"Generate speech, music, sound effects and multi-speaker dialogue from a single prompt "
|
"Generate speech, music, sound effects and multi-speaker dialogue from a single prompt "
|
||||||
"with ByteDance Seed Audio 1.0. Describe the voice(s), emotion, ambience, background music "
|
"with ByteDance Seed Audio 1.0. Describe the voice(s), emotion, ambience, background music "
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user