Keep Image v2 LoRA names and Flux/Krea chains when Comfy is asleep.
The Add picker vanished after the listing cache went empty, and switching engines wrote one stack over the other. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -80,24 +80,23 @@
|
||||
</ul>
|
||||
<p v-if="!clipStrength && model.length" class="mt-1 text-[11px] text-zinc-500">CLIP unused on this graph — model strength only.</p>
|
||||
<select
|
||||
v-if="availableNames.length && model.length < LORA_STACK_MAX"
|
||||
v-if="model.length < LORA_STACK_MAX"
|
||||
class="w-full rounded-xl border border-white/10 bg-zinc-950 outline-none ring-amber-300/40 focus:ring-2 disabled:opacity-50"
|
||||
:class="[
|
||||
compact ? 'px-2 py-1 text-xs' : 'px-3 py-2 text-sm',
|
||||
model.length ? 'mt-2' : ''
|
||||
]"
|
||||
:disabled="disabled"
|
||||
:disabled="disabled || !availableNames.length"
|
||||
:value="''"
|
||||
@change="onAdd"
|
||||
>
|
||||
<option value="">{{ model.length ? addLabel : emptyLabel }}</option>
|
||||
<option value="">{{ selectPlaceholder }}</option>
|
||||
<option
|
||||
v-for="name in availableNames"
|
||||
:key="name"
|
||||
:value="name"
|
||||
>{{ loraDisplayName(name) }}</option>
|
||||
</select>
|
||||
<p v-else-if="!model.length" class="text-[11px] text-zinc-500">{{ emptyLabel }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -120,6 +119,7 @@ const props = withDefaults(defineProps<{
|
||||
label?: string
|
||||
emptyLabel?: string
|
||||
addLabel?: string
|
||||
missingLabel?: string
|
||||
compact?: boolean
|
||||
disabled?: boolean
|
||||
clipStrength?: boolean
|
||||
@@ -127,6 +127,7 @@ const props = withDefaults(defineProps<{
|
||||
label: 'LoRA',
|
||||
emptyLabel: 'None',
|
||||
addLabel: 'Add LoRA',
|
||||
missingLabel: 'Wake GPU to load LoRAs',
|
||||
compact: false,
|
||||
disabled: false,
|
||||
clipStrength: true
|
||||
@@ -142,6 +143,13 @@ const availableNames = computed(() => {
|
||||
return props.names.filter(name => !taken.has(loraIdentityKey(name)))
|
||||
})
|
||||
|
||||
const selectPlaceholder = computed(() => {
|
||||
if (!availableNames.value.length) {
|
||||
return props.names.length ? 'All listed LoRAs are in the chain' : props.missingLabel
|
||||
}
|
||||
return model.value.length ? props.addLabel : props.emptyLabel
|
||||
})
|
||||
|
||||
function onAdd(event: Event) {
|
||||
const name = (event.target as HTMLSelectElement).value
|
||||
;(event.target as HTMLSelectElement).value = ''
|
||||
|
||||
Reference in New Issue
Block a user