Spaces:
Running
Running
preview condition
Browse files
src/lib/components/image-generation/Preview.svelte
CHANGED
|
@@ -3,9 +3,11 @@
|
|
| 3 |
export let res: string;
|
| 4 |
</script>
|
| 5 |
|
| 6 |
-
|
| 7 |
-
<div class="
|
| 8 |
-
<
|
| 9 |
-
|
|
|
|
|
|
|
| 10 |
</div>
|
| 11 |
-
|
|
|
|
| 3 |
export let res: string;
|
| 4 |
</script>
|
| 5 |
|
| 6 |
+
{#if res}
|
| 7 |
+
<div class="text-white p-6 font-code text-xs !leading-loose">
|
| 8 |
+
<div class="max-w-max relative ">
|
| 9 |
+
<img src={res} alt="" class="w-full max-w-lg object-contain" />
|
| 10 |
+
<div class="absolute bottom-3 left-3 bg-white/20 backdrop-blur-sm px-2 py-0.5 rounded-lg text-slate-900">{body?.inputs}</div>
|
| 11 |
+
</div>
|
| 12 |
</div>
|
| 13 |
+
{/if}
|
src/routes/api/image-generation/+server.ts
CHANGED
|
@@ -18,7 +18,7 @@ export async function POST({ request }: RequestEvent) {
|
|
| 18 |
headers: {
|
| 19 |
Authorization: `Bearer ${env.SECRET_HF_TOKEN}`,
|
| 20 |
'Content-Type': 'application/json',
|
| 21 |
-
|
| 22 |
},
|
| 23 |
body: JSON.stringify({
|
| 24 |
...body,
|
|
|
|
| 18 |
headers: {
|
| 19 |
Authorization: `Bearer ${env.SECRET_HF_TOKEN}`,
|
| 20 |
'Content-Type': 'application/json',
|
| 21 |
+
['x-use-cache']: "0"
|
| 22 |
},
|
| 23 |
body: JSON.stringify({
|
| 24 |
...body,
|