Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
update metadata
Browse files
src/routes/api/models/[id]/+server.ts
CHANGED
@@ -26,6 +26,7 @@ export async function GET({ url, params } : RequestEvent) {
|
|
26 |
instance_prompt: true,
|
27 |
metadata: true,
|
28 |
base_model: true,
|
|
|
29 |
gallery: {
|
30 |
select: {
|
31 |
id: true,
|
@@ -62,6 +63,7 @@ export async function GET({ url, params } : RequestEvent) {
|
|
62 |
image: true,
|
63 |
id: true,
|
64 |
metadata: true,
|
|
|
65 |
gallery: {
|
66 |
select: {
|
67 |
image: true,
|
@@ -102,7 +104,7 @@ export async function GET({ url, params } : RequestEvent) {
|
|
102 |
}
|
103 |
|
104 |
// get puppeteer screenshot
|
105 |
-
if (!model.metadata && metadata) {
|
106 |
const browser = await puppeteer.launch({
|
107 |
headless: true,
|
108 |
defaultViewport: {
|
|
|
26 |
instance_prompt: true,
|
27 |
metadata: true,
|
28 |
base_model: true,
|
29 |
+
isPublic: true,
|
30 |
gallery: {
|
31 |
select: {
|
32 |
id: true,
|
|
|
63 |
image: true,
|
64 |
id: true,
|
65 |
metadata: true,
|
66 |
+
isPublic: true,
|
67 |
gallery: {
|
68 |
select: {
|
69 |
image: true,
|
|
|
104 |
}
|
105 |
|
106 |
// get puppeteer screenshot
|
107 |
+
if (!model.metadata && metadata && model?.isPublic) {
|
108 |
const browser = await puppeteer.launch({
|
109 |
headless: true,
|
110 |
defaultViewport: {
|
src/routes/metadata/models/[userId]/[slug]/+page.svelte
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<script lang="ts">
|
|
|
|
|
2 |
export let data;
|
3 |
</script>
|
4 |
|
@@ -12,7 +14,7 @@
|
|
12 |
</h1>
|
13 |
|
14 |
</div>
|
15 |
-
<
|
16 |
</div>
|
17 |
</div>
|
18 |
</div>
|
|
|
1 |
<script lang="ts">
|
2 |
+
import Image from '$lib/components/models/image/Image.svelte';
|
3 |
+
|
4 |
export let data;
|
5 |
</script>
|
6 |
|
|
|
14 |
</h1>
|
15 |
|
16 |
</div>
|
17 |
+
<Image src={data?.model?.image} generatedImage={data?.model?.gallery?.[0]?.image} className="w-full h-full bg-center bg-cover rounded-lg object-cover object-center bg-neutral-800" alt={data?.model?.id} />
|
18 |
</div>
|
19 |
</div>
|
20 |
</div>
|