diff --git a/tests/test_api_images.py b/tests/test_api_images.py index 0798a63..c6c6d4b 100644 --- a/tests/test_api_images.py +++ b/tests/test_api_images.py @@ -986,8 +986,11 @@ class TestServeErrorBranches(ImageRouteCoverageCase): ): png = make_png(Path(lora) / "preview.png") image_id = self._link_image(png) + # An empty configured path means auto-detection; a developer's + # own config.json may hold a real LoraManager path, so pin it. with ( patch.object(IntegrationConfig, "LORA_MANAGER_ENABLED", True), + patch.object(IntegrationConfig, "LORA_MANAGER_PATH", ""), patch("py.lora_utils.find_lora_directories", return_value=[lora]), patch("py.lora_utils.get_lora_image_cache_dir", return_value=cache), ): @@ -998,6 +1001,7 @@ class TestServeErrorBranches(ImageRouteCoverageCase): with ( patch.object(IntegrationConfig, "LORA_MANAGER_ENABLED", True), + patch.object(IntegrationConfig, "LORA_MANAGER_PATH", ""), patch("py.lora_utils.find_lora_directories", side_effect=RuntimeError), ): resp = await self.client.request( diff --git a/web/js/admin.js b/web/js/admin.js index bd36ae3..708161d 100644 --- a/web/js/admin.js +++ b/web/js/admin.js @@ -3630,13 +3630,9 @@ Seed: ${this.currentMetadata.seed || 'Unknown'}`; const image = this.autoTagState.reviewImages[this.autoTagState.reviewIndex]; document.getElementById('reviewCurrentIndex').textContent = this.autoTagState.reviewIndex + 1; - // Build image URL from image_path (database field) - const imagePath = image.image_path; - const filename = imagePath.split('/').pop(); - // Use the serve endpoint with relative path - const relPath = imagePath.includes('/output/') ? - imagePath.substring(imagePath.indexOf('/output/') + 8) : filename; - const imageUrl = `/prompt_manager/images/serve/${relPath}`; + // The API describes images relative to the ComfyUI tree and + // always provides a servable url; never rebuild it from the path. + const imageUrl = this.getImageUrl(image); // Check if image already has real tags (excluding auto-scanned) const realTags = this.getRealTags(image.prompt_tags);