always save result as png
This commit is contained in:
@@ -501,13 +501,17 @@ export default function Editor(props: EditorProps) {
|
||||
}
|
||||
)
|
||||
|
||||
function download() {
|
||||
const download = async () => {
|
||||
if (file === undefined) {
|
||||
return
|
||||
}
|
||||
if (enableAutoSaving && renders.length > 0) {
|
||||
try {
|
||||
downloadToOutput(renders[renders.length - 1], file.name, file.type)
|
||||
await downloadToOutput(
|
||||
renders[renders.length - 1],
|
||||
file.name,
|
||||
file.type
|
||||
)
|
||||
toast({
|
||||
description: "Save image success",
|
||||
})
|
||||
|
||||
@@ -81,7 +81,7 @@ export default async function inpaint(
|
||||
"controlnet_conditioning_scale",
|
||||
settings.controlnetConditioningScale.toString()
|
||||
)
|
||||
fd.append("controlnet_method", settings.controlnetMethod.toString())
|
||||
fd.append("controlnet_method", settings.controlnetMethod?.toString())
|
||||
|
||||
// PowerPaint
|
||||
if (settings.showExtender) {
|
||||
@@ -213,6 +213,7 @@ export async function downloadToOutput(
|
||||
method: "POST",
|
||||
body: fd,
|
||||
})
|
||||
console.log(res.ok)
|
||||
if (!res.ok) {
|
||||
const errMsg = await res.text()
|
||||
throw new Error(errMsg)
|
||||
|
||||
Reference in New Issue
Block a user