Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
6c2bdb4
1
Parent(s):
2ab051d
add a little somethign to better detect errors
Browse files
src/utils/generateImageSDXL.mts
CHANGED
|
@@ -99,5 +99,9 @@ export async function generateImageSDXLAsBase64(options: {
|
|
| 99 |
secretToken
|
| 100 |
])) as any
|
| 101 |
|
| 102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
}
|
|
|
|
| 99 |
secretToken
|
| 100 |
])) as any
|
| 101 |
|
| 102 |
+
const result = rawResponse?.data?.[0] as string
|
| 103 |
+
if (!result?.length) {
|
| 104 |
+
throw new Error(`the returned image was empty`)
|
| 105 |
+
}
|
| 106 |
+
return result
|
| 107 |
}
|
src/utils/generateImageSDXL360.mts
CHANGED
|
@@ -83,5 +83,9 @@ export async function generateImageSDXL360AsBase64(options: {
|
|
| 83 |
secretToken,
|
| 84 |
])) as any
|
| 85 |
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
}
|
|
|
|
| 83 |
secretToken,
|
| 84 |
])) as any
|
| 85 |
|
| 86 |
+
const result = rawResponse?.data?.[0] as string
|
| 87 |
+
if (!result?.length) {
|
| 88 |
+
throw new Error(`the returned image was empty`)
|
| 89 |
+
}
|
| 90 |
+
return result
|
| 91 |
}
|