fix: AI 실행 결과물 다운로드 기능 개선

This commit is contained in:
hyojeong 2024-07-12 09:55:32 +09:00
parent 5f1064a294
commit 71e3b17ad4
2 changed files with 8 additions and 3 deletions

View File

@ -170,6 +170,7 @@
<div class="output-group">
Output:
<div id="progress-text">Ready</div>
<img id="output-image" src="" alt="Output Image" style="display: none; max-height: 100px;" />
<a id="image-link" href="" download>Download</a>
</div>
</div>

View File

@ -1371,9 +1371,13 @@ export class ComfyApp {
}
if(filename) {
const imageDisplay = document.getElementById('image-link');
imageDisplay.href = `/output/${filename}`;
imageDisplay.download = `${filename}`;
const imageDisplay = document.getElementById('output-image');
imageDisplay.src = `/view?filename=${filename}&subfolder=&type=output&rand=${Math.random()}`;
imageDisplay.style.display = 'block';
const imageLink = document.getElementById('image-link');
imageLink.href = `/view?filename=${filename}&subfolder=&type=output&rand=${Math.random()}`;
imageLink.download = `${filename}`;
const progressText = document.getElementById('progress-text');
progressText.textContent = "executed";