mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 07:05:43 -03:00
fix(import): allow zero lora recipes
This commit is contained in:
@@ -76,20 +76,23 @@ export class ImageProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get recipe data from response
|
// Get recipe data from response
|
||||||
this.importManager.recipeData = await response.json();
|
const recipeData = await response.json();
|
||||||
|
|
||||||
|
if (!recipeData) {
|
||||||
|
throw new Error('No recipe data returned from image analysis');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.importManager.recipeData = recipeData;
|
||||||
|
|
||||||
// Check if we have an error message
|
// Check if we have an error message
|
||||||
if (this.importManager.recipeData.error) {
|
if (this.importManager.recipeData.error) {
|
||||||
throw new Error(this.importManager.recipeData.error);
|
throw new Error(this.importManager.recipeData.error);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if we have valid recipe data
|
this.importManager.recipeData.loras = Array.isArray(this.importManager.recipeData.loras)
|
||||||
if (!this.importManager.recipeData ||
|
? this.importManager.recipeData.loras
|
||||||
!this.importManager.recipeData.loras ||
|
: [];
|
||||||
this.importManager.recipeData.loras.length === 0) {
|
|
||||||
throw new Error('No LoRA information found in this image');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find missing LoRAs
|
// Find missing LoRAs
|
||||||
this.importManager.missingLoras = this.importManager.recipeData.loras.filter(
|
this.importManager.missingLoras = this.importManager.recipeData.loras.filter(
|
||||||
lora => !lora.existsLocally
|
lora => !lora.existsLocally
|
||||||
@@ -124,20 +127,23 @@ export class ImageProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get recipe data from response
|
// Get recipe data from response
|
||||||
this.importManager.recipeData = await response.json();
|
const recipeData = await response.json();
|
||||||
|
|
||||||
|
if (!recipeData) {
|
||||||
|
throw new Error('No recipe data returned from image analysis');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.importManager.recipeData = recipeData;
|
||||||
|
|
||||||
// Check if we have an error message
|
// Check if we have an error message
|
||||||
if (this.importManager.recipeData.error) {
|
if (this.importManager.recipeData.error) {
|
||||||
throw new Error(this.importManager.recipeData.error);
|
throw new Error(this.importManager.recipeData.error);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if we have valid recipe data
|
this.importManager.recipeData.loras = Array.isArray(this.importManager.recipeData.loras)
|
||||||
if (!this.importManager.recipeData ||
|
? this.importManager.recipeData.loras
|
||||||
!this.importManager.recipeData.loras ||
|
: [];
|
||||||
this.importManager.recipeData.loras.length === 0) {
|
|
||||||
throw new Error('No LoRA information found in this image');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find missing LoRAs
|
// Find missing LoRAs
|
||||||
this.importManager.missingLoras = this.importManager.recipeData.loras.filter(
|
this.importManager.missingLoras = this.importManager.recipeData.loras.filter(
|
||||||
lora => !lora.existsLocally
|
lora => !lora.existsLocally
|
||||||
@@ -175,19 +181,22 @@ export class ImageProcessor {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Get recipe data from response
|
// Get recipe data from response
|
||||||
this.importManager.recipeData = await response.json();
|
const recipeData = await response.json();
|
||||||
|
|
||||||
|
if (!recipeData) {
|
||||||
|
throw new Error('No recipe data returned from image analysis');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.importManager.recipeData = recipeData;
|
||||||
|
|
||||||
// Check if we have an error message
|
// Check if we have an error message
|
||||||
if (this.importManager.recipeData.error) {
|
if (this.importManager.recipeData.error) {
|
||||||
throw new Error(this.importManager.recipeData.error);
|
throw new Error(this.importManager.recipeData.error);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if we have valid recipe data
|
this.importManager.recipeData.loras = Array.isArray(this.importManager.recipeData.loras)
|
||||||
if (!this.importManager.recipeData ||
|
? this.importManager.recipeData.loras
|
||||||
!this.importManager.recipeData.loras ||
|
: [];
|
||||||
this.importManager.recipeData.loras.length === 0) {
|
|
||||||
throw new Error('No LoRA information found in this image');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find missing LoRAs
|
// Find missing LoRAs
|
||||||
this.importManager.missingLoras = this.importManager.recipeData.loras.filter(
|
this.importManager.missingLoras = this.importManager.recipeData.loras.filter(
|
||||||
|
|||||||
Reference in New Issue
Block a user