V 1.0.0 - Symlink in preview

This commit is contained in:
DESKTOP-CNFQ7PM\Primere
2024-10-22 09:24:20 +02:00
parent 6a0e86cbb0
commit ead2f558b8
14 changed files with 3522 additions and 7 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ class PrimereVisualCKPT:
},
"hidden": {
"subdir": ("checkpoints",),
"sortbuttons": (['aScore', 'Name', 'Version', 'Path', 'Date'],),
"sortbuttons": (['aScore', 'Name', 'Version', 'Path', 'Date', 'Symlink'],),
"cache_key": ("model",),
}
}
+1 -1
View File
@@ -386,7 +386,7 @@ async def primere_get_filelinks(request):
is_link = os.path.islink(str(singleFile))
if is_link == True:
singleFile_link = Path(str(singleFile)).resolve()
filenameonly = Path(singleFile_link).stem
filenameonly = Path(singleFile).stem
comfyModelDir = os.path.join(utility.comfy_dir, 'models')
modelType = str(singleFile_link)[len(comfyModelDir) + 1:str(singleFile_link).find('\\', len(comfyModelDir) + 1)]
filelinktypes[filenameonly] = modelType
+27 -1
View File
@@ -4,6 +4,7 @@
@import url("../fonts/NIMBUSSANSDEE_BOLD/stylesheet.css"); /* NIMBUSSANSDEE BOLD */
@import url("../fonts/FUTURATEE_LIGHT/stylesheet.css"); /* FUTURATEE LIGHT */
@import url("../fonts/NIMBUSSANSDEE_LIGHT/stylesheet.css"); /* NIMBUSSANSDEE LIGHT */
@import url("../fonts/FUTURATEE_BOOK/stylesheet.css"); /* FUTURATEE BOOK */
/* Primere css for visual selectors */
#primere_visual_modal {
@@ -100,7 +101,7 @@
#primere_visual_modal .checkpoint-name {
overflow: hidden;
display: inline-block;
width: 99%;
width: 100%;
font-size: 11px;
font-weight: normal;
padding: 1px;
@@ -190,6 +191,31 @@
bottom: 0px;
}
#primere_visual_modal div.visual-symlink-type {
display: block;
position: absolute;
background-color: #0f5b77;
right: 0px;
top: 17px;
color: #c1deec;
white-space: nowrap;
padding-top: 1px;
padding-bottom: 1px;
padding-left: 5px;
padding-right: 5px;
border-left: #c1deec solid 1px;
border-bottom: #c1deec solid 1px;
-moz-border-radius-bottomleft: 4px;
-webkit-border-bottom-left-radius: 4px;
border-bottom-left-radius: 4px;
text-align: center;
font-family: 'FUTURATEE BOOK';
text-transform: capitalize;
font-size: 11px;
font-weight: normal;
letter-spacing: 1px;
}
#primere_visual_modal .visual-aesthetic-score {
display: block;
position: absolute;
Binary file not shown.
File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.
Binary file not shown.
@@ -0,0 +1,10 @@
@font-face {
font-family: 'FUTURATEE BOOK';
src: url('FUTURATEE-BOOK.eot');
src: url('FUTURATEE-BOOK.eot?#iefix') format('embedded-opentype'),
url('FUTURATEE-BOOK.ttf') format('truetype'),
url('FUTURATEE-BOOK.svg') format('svg'),
url('FUTURATEE-BOOK.woff') format('woff');
font-weight: normal;
font-style: normal;
}
File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 182 KiB

@@ -0,0 +1,8 @@
@font-face {
font-family: 'NIMBUSSANSDEE REGULAR';
src: url('NIMBUSSANSDEE-REGULAR.eot');
src: url('NIMBUSSANSDEE-REGULAR.eot?#iefix') format('embedded-opentype'),
url('NIMBUSSANSDEE-REGULAR.ttf') format('truetype'),
url('NIMBUSSANSDEE-REGULAR.svg') format('svg'),
url('NIMBUSSANSDEE-REGULAR.woff') format('woff');
}
+17 -4
View File
@@ -577,7 +577,7 @@ async function setup_visual_modal(combo_name, AllModels, ShowHidden, SelectedMod
}
}
if (nodeHelper['subdir'] == 'checkpoints') {
if (nodeHelper['subdir'] == 'checkpoints' && nodeHelper['sortbuttons'][0].indexOf("Symlink") > -1) {
FileLinkResponse = await ReadFileSymlink(nodeHelper['subdir']);
}
@@ -719,7 +719,8 @@ async function createCardElement(checkpoint, container, SelectedModel, ModelType
let pathLastIndex = finalName.lastIndexOf('/');
let ckptName = finalName.substring(pathLastIndex + 1);
let versionWidget = '';
let aesthVidget = '';
let aesthWidget = '';
let symlinkWidget = '';
var path_only = checkpoint.substring(0, checkpoint.indexOf("\\"));
if (ckptName == 'None') {
@@ -764,6 +765,18 @@ async function createCardElement(checkpoint, container, SelectedModel, ModelType
$(card).attr('data-date', 0);
}
if (FileLinkResponse.hasOwnProperty(ckptName) === true) {
var unetname = FileLinkResponse[ckptName];
$(card).attr('data-symlink', unetname);
var unetnameShort = unetname;
if (unetname == 'diffusion_models') { unetnameShort = 'DiMo'}
if (unetname == 'diffusers') { unetnameShort = 'Diff'}
symlinkWidget = '<div class="visual-symlink-type" title="Symlinked from: ' + unetname + '">' + unetnameShort + '</div>';
card_html += symlinkWidget;
} else {
$(card).attr('data-symlink', "");
}
if (SelectedModel === checkpoint) {
card.classList.add('visual-ckpt-selected');
}
@@ -780,8 +793,8 @@ async function createCardElement(checkpoint, container, SelectedModel, ModelType
if (aeScorePercentLine > 100) {
aeScorePercentLine = 100;
}
aesthVidget = '<div class="visual-aesthetic-score" title="' + aestAVGValue + ' / ' + aeScorePercentLine + '%">' + aestAVGValue + '<span> - ' + aeScorePercentLine + '%</span><hr style="width: ' + aeScorePercentLine + '%"></div>';
card_html += aesthVidget;
aesthWidget = '<div class="visual-aesthetic-score" title="' + aestAVGValue + ' / ' + aeScorePercentLine + '%">' + aestAVGValue + '<span> - ' + aeScorePercentLine + '%</span><hr style="width: ' + aeScorePercentLine + '%"></div>';
card_html += aesthWidget;
} else {
$(card).attr('data-ascore', 0);
}