Stable Diffusion: reference image visibility + editor placeholder - Show %reference_image% in the ComfyUI workflow editor placeholder list (with found/not-found highlight like the built-in placeholders). - Toast + console log which library image was selected for a generation; warn when the placeholder is present but the library is off/empty. - Redact base64 image payloads (avatars, reference images) from the workflow debug log instead of dumping megabytes of private image data into the browser console.
| @@ -23,6 +23,7 @@ | |||
| 23 | <li data-placeholder="height" class="sd_comfy_workflow_editor_not_found">"%height%"</li> | 23 | <li data-placeholder="height" class="sd_comfy_workflow_editor_not_found">"%height%"</li> |
| 24 | <li data-placeholder="user_avatar" class="sd_comfy_workflow_editor_not_found">"%user_avatar%"</li> | 24 | <li data-placeholder="user_avatar" class="sd_comfy_workflow_editor_not_found">"%user_avatar%"</li> |
| 25 | <li data-placeholder="char_avatar" class="sd_comfy_workflow_editor_not_found">"%char_avatar%"</li> | 25 | <li data-placeholder="char_avatar" class="sd_comfy_workflow_editor_not_found">"%char_avatar%"</li> |
| 26 | <li data-placeholder="reference_image" class="sd_comfy_workflow_editor_not_found" title="Best-fitting image from the Reference Image Library, selected by the image-prompt LLM">"%reference_image%"</li> | ||
| 26 | <li><hr></li> | 27 | <li><hr></li> |
| 27 | <li data-placeholder="seed" class="sd_comfy_workflow_editor_not_found"> | 28 | <li data-placeholder="seed" class="sd_comfy_workflow_editor_not_found"> |
| 28 | "%seed%" | 29 | "%seed%" |
| @@ -5252,11 +5252,18 @@ async function generateComfyImageCommon(prompt, negativePrompt, signal, basePath | |||
| 5252 | if (REFERENCE_IMAGE_PLACEHOLDER.test(workflow)) { | 5252 | if (REFERENCE_IMAGE_PLACEHOLDER.test(workflow)) { |
| 5253 | const refImage = await resolveReferenceImageForGeneration(prompt); | 5253 | const refImage = await resolveReferenceImageForGeneration(prompt); |
| 5254 | const refBase64 = (refImage && await fetchReferenceImageBase64(refImage)) || PNG_PIXEL; | 5254 | const refBase64 = (refImage && await fetchReferenceImageBase64(refImage)) || PNG_PIXEL; |
| 5255 | if (refBase64 !== PNG_PIXEL) { | ||
| 5256 | console.log(`SD: workflow reference image: "${refImage.tag}" (${refImage.path})`); | ||
| 5257 | toastr.info(`Reference image: ${refImage.tag || refImage.path}`, 'Image Generation'); | ||
| 5258 | } else { | ||
| 5259 | console.warn('SD: workflow uses %reference_image% but no library image was available; sending a transparent pixel'); | ||
| 5260 | } | ||
| 5255 | workflow = workflow.replaceAll('"%reference_image%"', JSON.stringify(refBase64)); | 5261 | workflow = workflow.replaceAll('"%reference_image%"', JSON.stringify(refBase64)); |
| 5256 | workflow = workflow.replaceAll('"%reference-image%"', JSON.stringify(refBase64)); | 5262 | workflow = workflow.replaceAll('"%reference-image%"', JSON.stringify(refBase64)); |
| 5257 | } | 5263 | } |
| 5264 | // Log the workflow with base64 image payloads redacted (avatars/reference images are private). | ||
| 5258 | console.log(`{ | 5265 | console.log(`{ |
| 5259 | "prompt": ${workflow} | 5266 | "prompt": ${workflow.replace(/"[A-Za-z0-9+/=]{200,}"/g, '"<base64 image redacted>"')} |
| 5260 | }`); | 5267 | }`); |
| 5261 | const promptResult = await fetch(`${basePath}/generate`, { | 5268 | const promptResult = await fetch(`${basePath}/generate`, { |
| 5262 | method: 'POST', | 5269 | method: 'POST', |