mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-07-21 21:01:24 +08:00
emph
This commit is contained in:
parent
1a03991313
commit
5bcf85a532
@ -21,7 +21,7 @@ class PromptChunk:
|
||||
|
||||
class AnimaTextProcessingEngine:
|
||||
def __init__(self, text_encoder, qwen_tokenizer, t5_tokenizer):
|
||||
super().__init__()
|
||||
self.emphasis = emphasis.get_current_option(opts.emphasis)()
|
||||
|
||||
self.text_encoder: "Qwen3_06B" = text_encoder
|
||||
self.qwen_tokenizer = qwen_tokenizer
|
||||
|
||||
@ -51,7 +51,7 @@ class CLIPEmbeddingForTextualInversion(torch.nn.Module):
|
||||
|
||||
class ClassicTextProcessingEngine:
|
||||
def __init__(self, text_encoder, tokenizer, chunk_length=75, embedding_dir=None, embedding_key="clip_l", embedding_expected_shape=768, text_projection=False, minimal_clip_skip=1, clip_skip=1, return_pooled=False, final_layer_norm=True):
|
||||
super().__init__()
|
||||
self.emphasis = emphasis.get_current_option(opts.emphasis)()
|
||||
|
||||
self.embeddings = EmbeddingDatabase(tokenizer, embedding_expected_shape)
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ class PromptChunk:
|
||||
|
||||
class GemmaTextProcessingEngine:
|
||||
def __init__(self, text_encoder, tokenizer):
|
||||
super().__init__()
|
||||
self.emphasis = emphasis.get_current_option(opts.emphasis)()
|
||||
|
||||
self.text_encoder = text_encoder
|
||||
self.tokenizer = tokenizer
|
||||
|
||||
@ -22,7 +22,7 @@ class PromptChunk:
|
||||
|
||||
class KleinTextProcessingEngine:
|
||||
def __init__(self, text_encoder, tokenizer):
|
||||
super().__init__()
|
||||
self.emphasis = emphasis.get_current_option(opts.emphasis)()
|
||||
|
||||
self.text_encoder = text_encoder
|
||||
self.tokenizer = tokenizer
|
||||
|
||||
@ -16,7 +16,7 @@ class PromptChunk:
|
||||
|
||||
class Ministral3TextProcessingEngine:
|
||||
def __init__(self, text_encoder, tokenizer):
|
||||
super().__init__()
|
||||
self.emphasis = emphasis.EmphasisNone()
|
||||
|
||||
self.text_encoder = text_encoder
|
||||
self.tokenizer = tokenizer
|
||||
|
||||
@ -22,7 +22,7 @@ re_attention = re.compile(
|
||||
re_break = re.compile(r"\s*\bBREAK\b\s*", re.S)
|
||||
|
||||
|
||||
def parse_prompt_attention(text, emphasis):
|
||||
def parse_prompt_attention(text: str, emphasis: str):
|
||||
res = []
|
||||
round_brackets = []
|
||||
square_brackets = []
|
||||
|
||||
@ -22,7 +22,7 @@ class PromptChunk:
|
||||
|
||||
class Qwen3TextProcessingEngine:
|
||||
def __init__(self, text_encoder, tokenizer):
|
||||
super().__init__()
|
||||
self.emphasis = emphasis.get_current_option(opts.emphasis)()
|
||||
|
||||
self.text_encoder = text_encoder
|
||||
self.tokenizer = tokenizer
|
||||
|
||||
@ -17,7 +17,7 @@ class PromptChunk:
|
||||
|
||||
class QwenTextProcessingEngine:
|
||||
def __init__(self, text_encoder, tokenizer):
|
||||
super().__init__()
|
||||
self.emphasis = emphasis.get_current_option(opts.emphasis)()
|
||||
|
||||
self.text_encoder = text_encoder
|
||||
self.tokenizer = tokenizer
|
||||
|
||||
@ -14,7 +14,7 @@ class PromptChunk:
|
||||
|
||||
class T5TextProcessingEngine:
|
||||
def __init__(self, text_encoder, tokenizer, min_length: int = 256, min_padding: int = -1):
|
||||
super().__init__()
|
||||
self.emphasis = emphasis.get_current_option(opts.emphasis)()
|
||||
|
||||
self.text_encoder = text_encoder.transformer
|
||||
self.tokenizer = tokenizer
|
||||
|
||||
@ -17,7 +17,7 @@ class PromptChunk:
|
||||
|
||||
class UMT5TextProcessingEngine:
|
||||
def __init__(self, text_encoder, tokenizer, min_length=512):
|
||||
super().__init__()
|
||||
self.emphasis = emphasis.get_current_option(opts.emphasis)()
|
||||
|
||||
self.text_encoder = text_encoder.transformer
|
||||
self.tokenizer = tokenizer
|
||||
|
||||
Loading…
Reference in New Issue
Block a user