我使用深度 AI API 将图像制作成卡通片并进行渲染,但现在我需要保存图像以便下载,我查看了堆栈溢出并找不到答案,(他们都使用 get 方法).
也很累 let Blob=await response.blob(); 它没有工作,它实际上停止了渲染!
(async function() {
let result=await deepai.callStandardApi("toonify",{
image: "<?php echo $url;?>"
});
let response=await deepai.renderResultIntoElement(result,document.getElementById('RES'));
let blob=response.blob();
//var file=new Blob(blob,{type:'image/jpeg'});
})();
saveAs(blob,"image/jpeg","image.jpeg");
它几乎就在那里,它试图下载到一个文件,但它在打开时说格式不正确。有什么想法吗?
在控制台中出现错误 Uncaught TypeError: File constructor: Argument 1 can't be convert to a sequence.