fix missing Emphasis infotext

This commit is contained in:
Haoming 2025-02-10 13:53:12 +08:00
parent 57e15ec9b5
commit 32319e1c1a
2 changed files with 4 additions and 4 deletions

View File

@ -763,6 +763,9 @@ def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments=None, iter
prompt_text = p.main_prompt if use_main_prompt else all_prompts[index]
negative_prompt = p.main_negative_prompt if use_main_prompt else all_negative_prompts[index]
if any(x for x in [prompt_text, negative_prompt] if "(" in x or "[" in x):
p.extra_generation_params["Emphasis"] = opts.emphasis
uses_ensd = opts.eta_noise_seed_delta != 0
if uses_ensd:
uses_ensd = sd_samplers_common.is_sampler_using_eta_noise_seed_delta(p)

View File

@ -202,7 +202,7 @@ class TextConditionalModel(torch.nn.Module):
Returns a tensor with shape of (B, T, C), where B is length of the array; T is length, in tokens, of texts (including padding) - T will
be a multiple of 77; and C is dimensionality of each token - for SD1 it's 768, for SD2 it's 1024, and for SDXL it's 1280.
An example shape returned by this function can be: (2, 77, 768).
For SDXL, instead of returning one tensor avobe, it returns a tuple with two: the other one with shape (B, 1280) with pooled values.
For SDXL, instead of returning one tensor above, it returns a tuple with two: the other one with shape (B, 1280) with pooled values.
Webui usually sends just one text at a time through this function - the only time when texts is an array with more than one element
is when you do prompt editing: "a picture of a [cat:dog:0.4] eating ice cream"
"""
@ -242,9 +242,6 @@ class TextConditionalModel(torch.nn.Module):
hashes.append(self.hijack.extra_generation_params.get("TI hashes"))
self.hijack.extra_generation_params["TI hashes"] = ", ".join(hashes)
if any(x for x in texts if "(" in x or "[" in x) and opts.emphasis != "Original":
self.hijack.extra_generation_params["Emphasis"] = opts.emphasis
if self.return_pooled:
return torch.hstack(zs), zs[0].pooled
else: