unique font family registration

Signed-off-by: Vladimir Mandic <mandic00@live.com>
pull/3722/head
Vladimir Mandic 2025-01-17 16:20:46 -05:00
parent b22e3d66fc
commit bfe8ece749
15 changed files with 19 additions and 15 deletions

View File

@ -11,6 +11,7 @@
- increase gallery timeouts
- update ui element ids
- modernui use local font
- unique font family registration
## Update for 2025-01-15

@ -1 +1 @@
Subproject commit aafc660ba3cf78724059917f7c3a05f3ac1ed46a
Subproject commit f55066aa419509fa0eafe92e4e98a4637b19b9c5

@ -1 +1 @@
Subproject commit d97615471c0121ff78c092bb85b620980686af38
Subproject commit e0b3e5918f49d090c8c340ca44e2c9e6d5bf5127

View File

@ -1,4 +1,4 @@
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSans'), url('notosans-nerdfont-regular.ttf') }
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSansNerd'), url('notosans-nerdfont-regular.ttf') }
/* toolbutton */
.gradio-button.tool { max-width: min-content; min-width: min-content !important; align-self: end; font-size: 1.4em; color: var(--body-text-color) !important; }

View File

@ -1,5 +1,5 @@
/* generic html tags */
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSans'), url('notosans-nerdfont-regular.ttf') }
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSansNerd'), url('notosans-nerdfont-regular.ttf') }
:root, .light, .dark {
--font: 'NotoSans';
--font-mono: 'ui-monospace', 'Consolas', monospace;

View File

@ -1,5 +1,5 @@
/* generic html tags */
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSans'), url('notosans-nerdfont-regular.ttf') }
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSansNerd'), url('notosans-nerdfont-regular.ttf') }
:root, .light, .dark {
--font: 'NotoSans';
--font-mono: 'ui-monospace', 'Consolas', monospace;

View File

@ -4,7 +4,7 @@
font-display: swap;
font-style: normal;
font-weight: 100;
src: local('NotoSans'), url('notosans-nerdfont-regular.ttf');
src: local('NotoSansNerd'), url('notosans-nerdfont-regular.ttf');
}
html {

View File

@ -1,5 +1,5 @@
/* generic html tags */
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSans'), url('notosans-nerdfont-regular.ttf') }
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSansNerd'), url('notosans-nerdfont-regular.ttf') }
:root, .light, .dark {
--font: 'NotoSans';
--font-mono: 'ui-monospace', 'Consolas', monospace;

View File

@ -1,5 +1,5 @@
/* generic html tags */
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSans'), url('notosans-nerdfont-regular.ttf') }
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSansNerd'), url('notosans-nerdfont-regular.ttf') }
:root, .light, .dark {
--font: 'NotoSans';
--font-mono: 'ui-monospace', 'Consolas', monospace;

View File

@ -1,4 +1,4 @@
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSans'), url('notosans-nerdfont-regular.ttf') }
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSansNerd'), url('notosans-nerdfont-regular.ttf') }
:root {
--left-column: 530px;
--color-trace: #666666;

View File

@ -1,5 +1,5 @@
/* generic html tags */
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSans'), url('notosans-nerdfont-regular.ttf') }
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSansNerd'), url('notosans-nerdfont-regular.ttf') }
:root, .light, .dark {
--font: 'NotoSans';
--font-mono: 'ui-monospace', 'Consolas', monospace;

View File

@ -1,5 +1,5 @@
/* generic html tags */
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSans'), url('notosans-nerdfont-regular.ttf') }
@font-face { font-family: 'NotoSans'; font-display: swap; font-style: normal; font-weight: 100; src: local('NotoSansNerd'), url('notosans-nerdfont-regular.ttf') }
:root, .light, .dark {
--font: 'NotoSans';
--font-mono: 'ui-monospace', 'Consolas', monospace;

View File

@ -135,7 +135,7 @@ def full_vae_decode(latents, model):
decoded = model.vae.decode(latents, return_dict=False)[0]
except Exception as e:
shared.log.error(f'VAE decode: {e}')
if 'out of memory' not in str(e):
if 'out of memory' not in str(e) and 'no data' not in str(e):
errors.display(e, 'VAE decode')
decoded = []

View File

@ -309,7 +309,8 @@ def read_metadata_from_safetensors(filename):
metadata_len = int.from_bytes(metadata_len, "little")
json_start = file.read(2)
if metadata_len <= 2 or json_start not in (b'{"', b"{'"):
shared.log.error(f'Model metadata invalid: file="{filename}"')
shared.log.error(f'Model metadata invalid: file="{filename}" len={metadata_len} start={json_start}')
return res
json_data = json_start + file.read(metadata_len-2)
json_obj = json.loads(json_data)
for k, v in json_obj.get("__metadata__", {}).items():
@ -332,6 +333,8 @@ def read_metadata_from_safetensors(filename):
res[k] = v
except Exception as e:
shared.log.error(f'Model metadata: file="{filename}" {e}')
from modules import errors
errors.display(e, 'Model metadata')
sd_metadata[filename] = res
global sd_metadata_pending # pylint: disable=global-statement
sd_metadata_pending += 1

View File

@ -518,9 +518,9 @@ options_templates.update(options_section(('text_encoder', "Text Encoder"), {
options_templates.update(options_section(('cuda', "Compute Settings"), {
"math_sep": OptionInfo("<h2>Execution Precision</h2>", "", gr.HTML),
"precision": OptionInfo("Autocast", "Precision type", gr.Radio, {"choices": ["Autocast", "Full"]}),
"precision": OptionInfo("Autocast", "Precision type", gr.Radio, {"choices": ["Autocast", "Full"], "visible": not native}),
"cuda_dtype": OptionInfo("Auto", "Device precision type", gr.Radio, {"choices": ["Auto", "FP32", "FP16", "BF16"]}),
"no_half": OptionInfo(False if not cmd_opts.use_openvino else True, "Full precision (--no-half)", None, None, None),
"no_half": OptionInfo(False if not cmd_opts.use_openvino else True, "Force full precision (--no-half)", None, None, None),
"upcast_sampling": OptionInfo(False if sys.platform != "darwin" else True, "Upcast sampling", gr.Checkbox, {"visible": not native}),
"upcast_attn": OptionInfo(False, "Upcast attention layer", gr.Checkbox, {"visible": not native}),
"cuda_cast_unet": OptionInfo(False, "Fixed UNet precision", gr.Checkbox, {"visible": not native}),