Spaces:
Runtime error
Runtime error
Esteves Enzo
commited on
Commit
•
6b92c38
1
Parent(s):
2a63a7e
add api part
Browse files- .next/build-manifest.json +2 -13
- .next/cache/webpack/client-development/1.pack.gz +2 -2
- .next/cache/webpack/client-development/2.pack.gz +2 -2
- .next/cache/webpack/client-development/3.pack.gz +2 -2
- .next/cache/webpack/client-development/4.pack.gz +2 -2
- .next/cache/webpack/client-development/5.pack.gz +2 -2
- .next/cache/webpack/client-development/6.pack.gz +2 -2
- .next/cache/webpack/client-development/7.pack.gz +2 -2
- .next/cache/webpack/client-development/8.pack.gz +2 -2
- .next/cache/webpack/client-development/index.pack.gz +2 -2
- .next/cache/webpack/client-development/index.pack.gz.old +0 -0
- .next/cache/webpack/server-development/0.pack.gz +2 -2
- .next/cache/webpack/server-development/1.pack.gz +2 -2
- .next/cache/webpack/server-development/10.pack.gz +2 -2
- .next/cache/webpack/server-development/11.pack.gz +2 -2
- .next/cache/webpack/server-development/12.pack.gz +2 -2
- .next/cache/webpack/server-development/13.pack.gz +2 -2
- .next/cache/webpack/server-development/14.pack.gz +2 -2
- .next/cache/webpack/server-development/15.pack.gz +2 -2
- .next/cache/webpack/server-development/2.pack.gz +2 -2
- .next/cache/webpack/server-development/3.pack.gz +2 -2
- .next/cache/webpack/server-development/4.pack.gz +2 -2
- .next/cache/webpack/server-development/5.pack.gz +2 -2
- .next/cache/webpack/server-development/6.pack.gz +2 -2
- .next/cache/webpack/server-development/7.pack.gz +2 -2
- .next/cache/webpack/server-development/9.pack.gz +2 -2
- .next/cache/webpack/server-development/index.pack.gz +2 -2
- .next/cache/webpack/server-development/index.pack.gz.old +0 -0
- .next/server/app-paths-manifest.json +2 -1
- .next/server/middleware-build-manifest.js +1 -1
- .next/server/pages-manifest.json +1 -5
- .next/static/development/_buildManifest.js +1 -1
- .next/trace +0 -0
- app/api/route.ts +26 -0
- assets/.DS_Store +0 -0
- components/main/hooks/useInputGeneration.ts +5 -6
.next/build-manifest.json
CHANGED
@@ -2,9 +2,7 @@
|
|
2 |
"polyfillFiles": [
|
3 |
"static/chunks/polyfills.js"
|
4 |
],
|
5 |
-
"devFiles": [
|
6 |
-
"static/chunks/react-refresh.js"
|
7 |
-
],
|
8 |
"ampDevFiles": [],
|
9 |
"lowPriorityFiles": [
|
10 |
"static/development/_buildManifest.js",
|
@@ -15,16 +13,7 @@
|
|
15 |
"static/chunks/main-app.js"
|
16 |
],
|
17 |
"pages": {
|
18 |
-
"/_app": [
|
19 |
-
"static/chunks/webpack.js",
|
20 |
-
"static/chunks/main.js",
|
21 |
-
"static/chunks/pages/_app.js"
|
22 |
-
],
|
23 |
-
"/_error": [
|
24 |
-
"static/chunks/webpack.js",
|
25 |
-
"static/chunks/main.js",
|
26 |
-
"static/chunks/pages/_error.js"
|
27 |
-
]
|
28 |
},
|
29 |
"ampFirstPages": []
|
30 |
}
|
|
|
2 |
"polyfillFiles": [
|
3 |
"static/chunks/polyfills.js"
|
4 |
],
|
5 |
+
"devFiles": [],
|
|
|
|
|
6 |
"ampDevFiles": [],
|
7 |
"lowPriorityFiles": [
|
8 |
"static/development/_buildManifest.js",
|
|
|
13 |
"static/chunks/main-app.js"
|
14 |
],
|
15 |
"pages": {
|
16 |
+
"/_app": []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
},
|
18 |
"ampFirstPages": []
|
19 |
}
|
.next/cache/webpack/client-development/1.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:234891e5cea7b9577ecf1a1817f61fea3c959fd2ccbaf97fc592f23603d050eb
|
3 |
+
size 5153
|
.next/cache/webpack/client-development/2.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:09fc7881ddecfa656d58371895bcf62eeae12b4e5b7473bee96275e772b92689
|
3 |
+
size 24066
|
.next/cache/webpack/client-development/3.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e6ee4e5f7dc0555735b16c9e9a534f2adc5e320dbc19344b419f54f5a68a7079
|
3 |
+
size 227635
|
.next/cache/webpack/client-development/4.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:685adc15f9da46b5b2dcdc707f9fdfb3c550313db90e9a0133a42b01be23fdde
|
3 |
+
size 52276
|
.next/cache/webpack/client-development/5.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:491eb7ab8bf0ec74ddb3795fc38dc26385c707224edc47d1c87dbcef21e1ec8a
|
3 |
+
size 1714
|
.next/cache/webpack/client-development/6.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a5fb4df0183af7e5ffad56cb0a277642115c1ae6d8074c0caf502c403137c7d8
|
3 |
+
size 11616
|
.next/cache/webpack/client-development/7.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fe413f7582eae1321387b466f43b42587b08915d310674da350c0e060246b081
|
3 |
+
size 3565495
|
.next/cache/webpack/client-development/8.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a60741c454a20f3573bb9536741360561b82fae863b207e7ff51bd37de0907f3
|
3 |
+
size 11318419
|
.next/cache/webpack/client-development/index.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dd6a04baaef131b97ed5733efdbbbeab07e5bbd74f827cc3797def9e5f8a1d69
|
3 |
+
size 176067
|
.next/cache/webpack/client-development/index.pack.gz.old
CHANGED
Binary files a/.next/cache/webpack/client-development/index.pack.gz.old and b/.next/cache/webpack/client-development/index.pack.gz.old differ
|
|
.next/cache/webpack/server-development/0.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f67d98f6716478bf12a5b7784cdee0fe26e448b90cbb39923111c3a2cc91eee1
|
3 |
+
size 4538
|
.next/cache/webpack/server-development/1.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a6f93c5c7a9a684efc54a04937c0e29708ef9f88a64d003a7d34ef00773da391
|
3 |
+
size 1384
|
.next/cache/webpack/server-development/10.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b44c5f240f6f677392b4e94b2d295bb4bfb4a456b86b6fdce409f785b80e9ddd
|
3 |
+
size 24135
|
.next/cache/webpack/server-development/11.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:86bc686ea10d0661ab3010d473a9ed8310845dbd2d6c92f9119ef3eda722c34e
|
3 |
+
size 227391
|
.next/cache/webpack/server-development/12.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:da86b323d6211a8ffdc18e689cec7e0051589e1892f549af7d243629672127cf
|
3 |
+
size 6539
|
.next/cache/webpack/server-development/13.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a5b08d5a3b1495160eb52cf64171929a701fa80a25b0e9f23b27ac0dfb8ec99b
|
3 |
+
size 96671
|
.next/cache/webpack/server-development/14.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8585e4160a81feb6a85110f113397f4a83546271bd591852dd39d03b1aa8b289
|
3 |
+
size 65613
|
.next/cache/webpack/server-development/15.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d87d41d49d565a8ea0d58e77d29d27c8bff9eb0f3a43dc17184323674fd9a23e
|
3 |
+
size 2942850
|
.next/cache/webpack/server-development/2.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9250fe4816b49af7987bee3a3dca9e25c97895dd0a153f211371c95eed3913ae
|
3 |
+
size 30803
|
.next/cache/webpack/server-development/3.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b3f408cda42a62770b4ec10ac432a731251f3c84c019e4a54fb6942e35f47bfa
|
3 |
+
size 2806105
|
.next/cache/webpack/server-development/4.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fe8e2688e893ef14178361c7e510c0ad08de485c56b916267d735b715da21114
|
3 |
+
size 4241
|
.next/cache/webpack/server-development/5.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8f225ddf07b9c1410a7e6c4ae2697f710d572a94ec64239bac36e94d54922483
|
3 |
+
size 4077
|
.next/cache/webpack/server-development/6.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8d565f9341446d906104d346568ca37bc40fc564c028ecf91cc02c202ee5f534
|
3 |
+
size 1638732
|
.next/cache/webpack/server-development/7.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:766b38b2f3e781544acf29e8f94b1fa6f5a45bb28de75292e8453ebb382da0a1
|
3 |
+
size 1772521
|
.next/cache/webpack/server-development/9.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:381abe916a1f820f310484bb98f8e1ee9fb5775acdc7edee5a246692a8c8bab4
|
3 |
+
size 8690
|
.next/cache/webpack/server-development/index.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:953400e4317758ba31d2c03cea3b9cbee7fdd92fb998e8588913e4f5e804e09f
|
3 |
+
size 133229
|
.next/cache/webpack/server-development/index.pack.gz.old
CHANGED
Binary files a/.next/cache/webpack/server-development/index.pack.gz.old and b/.next/cache/webpack/server-development/index.pack.gz.old differ
|
|
.next/server/app-paths-manifest.json
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
{
|
2 |
-
"/page": "app/page.js"
|
|
|
3 |
}
|
|
|
1 |
{
|
2 |
+
"/page": "app/page.js",
|
3 |
+
"/api/route": "app/api/route.js"
|
4 |
}
|
.next/server/middleware-build-manifest.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
self.__BUILD_MANIFEST={"polyfillFiles":["static/chunks/polyfills.js"],"devFiles":[
|
|
|
1 |
+
self.__BUILD_MANIFEST={"polyfillFiles":["static/chunks/polyfills.js"],"devFiles":[],"ampDevFiles":[],"lowPriorityFiles":["static/development/_buildManifest.js","static/development/_ssgManifest.js"],"rootMainFiles":["static/chunks/webpack.js","static/chunks/main-app.js"],"pages":{"/_app":[]},"ampFirstPages":[]}
|
.next/server/pages-manifest.json
CHANGED
@@ -1,5 +1 @@
|
|
1 |
-
{
|
2 |
-
"/_app": "pages/_app.js",
|
3 |
-
"/_error": "pages/_error.js",
|
4 |
-
"/_document": "pages/_document.js"
|
5 |
-
}
|
|
|
1 |
+
{}
|
|
|
|
|
|
|
|
.next/static/development/_buildManifest.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
self.__BUILD_MANIFEST = {__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},
|
|
|
1 |
+
self.__BUILD_MANIFEST = {__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},sortedPages:["\u002F_app"]};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()
|
.next/trace
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
app/api/route.ts
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { NextResponse } from "next/server";
|
2 |
+
|
3 |
+
export async function POST(
|
4 |
+
request: Request,
|
5 |
+
) {
|
6 |
+
const { inputs } = await request.json()
|
7 |
+
|
8 |
+
const response = await fetch('https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0', {
|
9 |
+
method: 'POST',
|
10 |
+
body: JSON.stringify({
|
11 |
+
inputs,
|
12 |
+
}),
|
13 |
+
headers: {
|
14 |
+
Authorization: `Bearer ${process.env.NEXT_APP_HF_TOKEN}`,
|
15 |
+
'Content-Type': 'application/json',
|
16 |
+
},
|
17 |
+
})
|
18 |
+
|
19 |
+
const blob = await response.blob()
|
20 |
+
const headers = new Headers();
|
21 |
+
|
22 |
+
headers.set("Content-Type", "image/*");
|
23 |
+
|
24 |
+
// or just use new Response ❗️
|
25 |
+
return new NextResponse(blob, { status: 200, statusText: "OK", headers });
|
26 |
+
}
|
assets/.DS_Store
CHANGED
Binary files a/assets/.DS_Store and b/assets/.DS_Store differ
|
|
components/main/hooks/useInputGeneration.ts
CHANGED
@@ -8,19 +8,18 @@ export const useInputGeneration = () => {
|
|
8 |
setLoading(true)
|
9 |
return new Promise(async (resolve, reject) => {
|
10 |
fetch(
|
11 |
-
'
|
12 |
{
|
13 |
-
headers: {
|
14 |
-
Authorization: `Bearer {TOKEN}`,
|
15 |
-
'Content-Type': 'application/json',
|
16 |
-
},
|
17 |
method: 'POST',
|
18 |
body: JSON.stringify({
|
19 |
inputs: prompt,
|
20 |
})
|
21 |
}
|
22 |
)
|
23 |
-
.then(
|
|
|
|
|
|
|
24 |
.finally(() => {
|
25 |
setLoading(false)
|
26 |
resolve(true)
|
|
|
8 |
setLoading(true)
|
9 |
return new Promise(async (resolve, reject) => {
|
10 |
fetch(
|
11 |
+
'/api',
|
12 |
{
|
|
|
|
|
|
|
|
|
13 |
method: 'POST',
|
14 |
body: JSON.stringify({
|
15 |
inputs: prompt,
|
16 |
})
|
17 |
}
|
18 |
)
|
19 |
+
.then(res => {
|
20 |
+
console.log(res)
|
21 |
+
resolve(true)
|
22 |
+
})
|
23 |
.finally(() => {
|
24 |
setLoading(false)
|
25 |
resolve(true)
|