mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
networks reference style
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
+1
-1
@@ -177,7 +177,7 @@ log.info(f'Engine: backend={backend} compute={devices.backend} device={devices.g
|
||||
profiler = None
|
||||
import modules.styles
|
||||
prompt_styles = modules.styles.StyleDatabase(opts)
|
||||
reference_models = readfile(os.path.join('data', 'reference.json'), as_type="dict") if opts.extra_network_reference_enable else {}
|
||||
reference_models = {}
|
||||
cmd_opts.disable_extension_access = (cmd_opts.share or cmd_opts.listen or (cmd_opts.server_name or False)) and not cmd_opts.insecure
|
||||
|
||||
log.debug('Initializing: devices')
|
||||
|
||||
@@ -314,6 +314,7 @@ class ExtraNetworksPage:
|
||||
subdirs = OrderedDict(sorted(subdirs.items()))
|
||||
if self.name == 'model' and shared.opts.extra_network_reference_enable:
|
||||
subdirs['Local'] = 1
|
||||
subdirs['Base'] = 1
|
||||
subdirs['Reference'] = 1
|
||||
subdirs['Distilled'] = 1
|
||||
subdirs['Quantized'] = 1
|
||||
@@ -331,6 +332,8 @@ class ExtraNetworksPage:
|
||||
subdirs.move_to_end('Local', last=True)
|
||||
if os.path.basename(shared.opts.diffusers_dir) in subdirs:
|
||||
subdirs.move_to_end(os.path.basename(shared.opts.diffusers_dir), last=True)
|
||||
if 'Base' in subdirs:
|
||||
subdirs.move_to_end('Base', last=True)
|
||||
if 'Reference' in subdirs:
|
||||
subdirs.move_to_end('Reference', last=True)
|
||||
if 'Distilled' in subdirs:
|
||||
@@ -347,7 +350,9 @@ class ExtraNetworksPage:
|
||||
for subdir in subdirs:
|
||||
if len(subdir) == 0:
|
||||
continue
|
||||
if subdir in ['All', 'Local', 'Diffusers', 'Reference', 'Distilled', 'Quantized', 'Nunchaku', 'Community', 'Cloud']:
|
||||
if subdir in ['All', 'Local', 'Diffusers']:
|
||||
style = 'network-local'
|
||||
elif subdir in ['Base', 'Reference', 'Distilled', 'Quantized', 'Nunchaku', 'Community', 'Cloud']:
|
||||
style = 'network-reference'
|
||||
else:
|
||||
style = 'network-folder'
|
||||
|
||||
@@ -22,6 +22,7 @@ version_map = {
|
||||
"WanVACE": "Wan",
|
||||
"Z": "Z-Image",
|
||||
"Glm": "GLM-Image",
|
||||
"AnimaTextTo": "Anima",
|
||||
}
|
||||
|
||||
class ExtraNetworksPageCheckpoints(ui_extra_networks.ExtraNetworksPage):
|
||||
@@ -44,19 +45,14 @@ class ExtraNetworksPageCheckpoints(ui_extra_networks.ExtraNetworksPage):
|
||||
return []
|
||||
count = { 'total': 0, 'ready': 0, 'hidden': 0, 'experimental': 0, 'base': 0, 'quantized': 0, 'distilled': 0, 'community': 0, 'cloud': 0, 'nunchaku': 0 }
|
||||
|
||||
reference_base = readfile(os.path.join('data', 'reference.json'), as_type="dict")
|
||||
reference_quant = readfile(os.path.join('data', 'reference-quant.json'), as_type="dict")
|
||||
reference_distilled = readfile(os.path.join('data', 'reference-distilled.json'), as_type="dict")
|
||||
reference_community = readfile(os.path.join('data', 'reference-community.json'), as_type="dict")
|
||||
reference_cloud = readfile(os.path.join('data', 'reference-cloud.json'), as_type="dict")
|
||||
reference_nunchaku = readfile(os.path.join('data', 'reference-nunchaku.json'), as_type="dict")
|
||||
shared.reference_models = {}
|
||||
shared.reference_models.update(reference_base)
|
||||
shared.reference_models.update(reference_quant)
|
||||
shared.reference_models.update(reference_community)
|
||||
shared.reference_models.update(reference_distilled)
|
||||
shared.reference_models.update(reference_cloud)
|
||||
shared.reference_models.update(reference_nunchaku)
|
||||
for tag in count.keys():
|
||||
fn = os.path.join('data', f'reference-{tag}.json')
|
||||
dct = readfile(fn, as_type="dict", silent=True)
|
||||
for k, v in dct.items():
|
||||
v['skip'] = 'safetensors' not in v.get('path', '')
|
||||
v['tags'] = tag
|
||||
shared.reference_models[k] = v
|
||||
|
||||
for k, v in shared.reference_models.items():
|
||||
count['total'] += 1
|
||||
|
||||
@@ -1574,6 +1574,15 @@ table.settings-value-table td {
|
||||
margin-right: 0.8em;
|
||||
}
|
||||
|
||||
.network-local {
|
||||
filter: contrast(0.8);
|
||||
}
|
||||
|
||||
.network-local::before {
|
||||
content: " ";
|
||||
margin-right: 0.8em;
|
||||
}
|
||||
|
||||
.network-reference {
|
||||
filter: contrast(0.9);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user