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"> <div class="output-group">
Output: Output:
<div id="progress-text">Ready</div> <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> <a id="image-link" href="" download>Download</a>
</div> </div>
</div> </div>

View File

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