mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
autocomplete dont fetch disabled networks
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
+19
-11
@@ -108,19 +108,27 @@ export const xnEngine: XnEngine = {
|
||||
this.lora = new XnIndex(items);
|
||||
}
|
||||
// Embeddings: {loaded: [...], skipped: [...]}
|
||||
const embData = await this.fetchJson('/embeddings') as Record<string, unknown> | null;
|
||||
if (embData && typeof embData === 'object') {
|
||||
const loaded = Array.isArray(embData.loaded) ? embData.loaded : [];
|
||||
this.embed = new XnIndex(loaded.map((name) => ({ name: String(name) })));
|
||||
if (window.opts.diffusers_enable_embed) {
|
||||
const embData = await this.fetchJson('/embeddings') as Record<string, unknown> | null;
|
||||
if (embData && typeof embData === 'object') {
|
||||
const loaded = Array.isArray(embData.loaded) ? embData.loaded : [];
|
||||
this.embed = new XnIndex(loaded.map((name) => ({ name: String(name) })));
|
||||
}
|
||||
} else {
|
||||
this.embed = new XnIndex([]);
|
||||
}
|
||||
// Wildcards: [{name}, ...]
|
||||
const wcData = await this.fetchJson('/wildcards');
|
||||
if (Array.isArray(wcData)) {
|
||||
this.wildcard = new XnIndex(
|
||||
wcData
|
||||
.filter((w) => typeof w === 'object' && w && 'name' in w && typeof w.name === 'string')
|
||||
.map((w) => ({ name: w.name })),
|
||||
);
|
||||
if (window.opts.wildcards_enabled) {
|
||||
const wcData = await this.fetchJson('/wildcards');
|
||||
if (Array.isArray(wcData)) {
|
||||
this.wildcard = new XnIndex(
|
||||
wcData
|
||||
.filter((w) => typeof w === 'object' && w && 'name' in w && typeof w.name === 'string')
|
||||
.map((w) => ({ name: w.name })),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
this.wildcard = new XnIndex([]);
|
||||
}
|
||||
log('autoComplete', {
|
||||
xnLoaded: true,
|
||||
|
||||
Vendored
+17
-9
@@ -14759,16 +14759,24 @@ var xnEngine = {
|
||||
}
|
||||
this.lora = new XnIndex(items);
|
||||
}
|
||||
const embData = await this.fetchJson("/embeddings");
|
||||
if (embData && typeof embData === "object") {
|
||||
const loaded = Array.isArray(embData.loaded) ? embData.loaded : [];
|
||||
this.embed = new XnIndex(loaded.map((name) => ({ name: String(name) })));
|
||||
if (window.opts.diffusers_enable_embed) {
|
||||
const embData = await this.fetchJson("/embeddings");
|
||||
if (embData && typeof embData === "object") {
|
||||
const loaded = Array.isArray(embData.loaded) ? embData.loaded : [];
|
||||
this.embed = new XnIndex(loaded.map((name) => ({ name: String(name) })));
|
||||
}
|
||||
} else {
|
||||
this.embed = new XnIndex([]);
|
||||
}
|
||||
const wcData = await this.fetchJson("/wildcards");
|
||||
if (Array.isArray(wcData)) {
|
||||
this.wildcard = new XnIndex(
|
||||
wcData.filter((w) => typeof w === "object" && w && "name" in w && typeof w.name === "string").map((w) => ({ name: w.name }))
|
||||
);
|
||||
if (window.opts.wildcards_enabled) {
|
||||
const wcData = await this.fetchJson("/wildcards");
|
||||
if (Array.isArray(wcData)) {
|
||||
this.wildcard = new XnIndex(
|
||||
wcData.filter((w) => typeof w === "object" && w && "name" in w && typeof w.name === "string").map((w) => ({ name: w.name }))
|
||||
);
|
||||
}
|
||||
} else {
|
||||
this.wildcard = new XnIndex([]);
|
||||
}
|
||||
log("autoComplete", {
|
||||
xnLoaded: true,
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user