diff --git a/py/services/recipe_scanner.py b/py/services/recipe_scanner.py index a27ff074..6d8491ae 100644 --- a/py/services/recipe_scanner.py +++ b/py/services/recipe_scanner.py @@ -824,7 +824,7 @@ class RecipeScanner: fingerprint: The recipe fingerprint to search for Returns: - List of recipe IDs that match the fingerprint + List of recipe details that match the fingerprint """ if not fingerprint: return [] @@ -836,7 +836,15 @@ class RecipeScanner: matching_recipes = [] for recipe in cache.raw_data: if recipe.get('fingerprint') == fingerprint: - matching_recipes.append(recipe.get('id')) + recipe_details = { + 'id': recipe.get('id'), + 'title': recipe.get('title'), + 'file_url': self._format_file_url(recipe.get('file_path')), + 'modified': recipe.get('modified'), + 'created_date': recipe.get('created_date'), + 'lora_count': len(recipe.get('loras', [])) + } + matching_recipes.append(recipe_details) return matching_recipes diff --git a/py/utils/utils.py b/py/utils/utils.py index 4ab6b3ba..054d0482 100644 --- a/py/utils/utils.py +++ b/py/utils/utils.py @@ -148,8 +148,8 @@ def calculate_recipe_fingerprint(loras): if not hash_value: continue - # Normalize strength to 2 decimal places - strength = round(float(lora.get("strength", 1.0)), 2) + # Normalize strength to 2 decimal places (check both strength and weight fields) + strength = round(float(lora.get("strength", lora.get("weight", 1.0))), 2) valid_loras.append((hash_value, strength)) diff --git a/static/js/managers/import/DownloadManager.js b/static/js/managers/import/DownloadManager.js index 058ba9cb..536ae3e0 100644 --- a/static/js/managers/import/DownloadManager.js +++ b/static/js/managers/import/DownloadManager.js @@ -56,7 +56,6 @@ export class DownloadManager { // Add source_path to metadata to track where the recipe was imported from if (this.importManager.importMode === 'url') { const urlInput = document.getElementById('imageUrlInput'); - console.log("urlInput.value", urlInput.value); if (urlInput && urlInput.value) { completeMetadata.source_path = urlInput.value; } diff --git a/static/js/managers/import/ImageProcessor.js b/static/js/managers/import/ImageProcessor.js index be568d50..5b316837 100644 --- a/static/js/managers/import/ImageProcessor.js +++ b/static/js/managers/import/ImageProcessor.js @@ -170,8 +170,6 @@ export class ImageProcessor { // Get recipe data from response this.importManager.recipeData = await response.json(); - console.log('Recipe data:', this.importManager.recipeData); - // Check if we have an error message if (this.importManager.recipeData.error) { throw new Error(this.importManager.recipeData.error); @@ -184,11 +182,6 @@ export class ImageProcessor { throw new Error('No LoRA information found in this image'); } - // Store generation parameters if available - if (this.importManager.recipeData.gen_params) { - console.log('Generation parameters found:', this.importManager.recipeData.gen_params); - } - // Find missing LoRAs this.importManager.missingLoras = this.importManager.recipeData.loras.filter( lora => !lora.existsLocally