fix: review flow uses the served image url and the lora-dirs test pins its config
Image paths in API responses are now relative to the ComfyUI tree, so the auto-tag review page can no longer derive a serve URL from image_path; the server always provides url. The lora-dirs serving test assumed an empty LoraManager path, which only held in a checkout without a local config.json.
This commit is contained in:
@@ -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(
|
||||
|
||||
+3
-7
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user