Esteves Enzo commited on
Commit
6b92c38
1 Parent(s): 2a63a7e

add api part

Browse files
Files changed (36) hide show
  1. .next/build-manifest.json +2 -13
  2. .next/cache/webpack/client-development/1.pack.gz +2 -2
  3. .next/cache/webpack/client-development/2.pack.gz +2 -2
  4. .next/cache/webpack/client-development/3.pack.gz +2 -2
  5. .next/cache/webpack/client-development/4.pack.gz +2 -2
  6. .next/cache/webpack/client-development/5.pack.gz +2 -2
  7. .next/cache/webpack/client-development/6.pack.gz +2 -2
  8. .next/cache/webpack/client-development/7.pack.gz +2 -2
  9. .next/cache/webpack/client-development/8.pack.gz +2 -2
  10. .next/cache/webpack/client-development/index.pack.gz +2 -2
  11. .next/cache/webpack/client-development/index.pack.gz.old +0 -0
  12. .next/cache/webpack/server-development/0.pack.gz +2 -2
  13. .next/cache/webpack/server-development/1.pack.gz +2 -2
  14. .next/cache/webpack/server-development/10.pack.gz +2 -2
  15. .next/cache/webpack/server-development/11.pack.gz +2 -2
  16. .next/cache/webpack/server-development/12.pack.gz +2 -2
  17. .next/cache/webpack/server-development/13.pack.gz +2 -2
  18. .next/cache/webpack/server-development/14.pack.gz +2 -2
  19. .next/cache/webpack/server-development/15.pack.gz +2 -2
  20. .next/cache/webpack/server-development/2.pack.gz +2 -2
  21. .next/cache/webpack/server-development/3.pack.gz +2 -2
  22. .next/cache/webpack/server-development/4.pack.gz +2 -2
  23. .next/cache/webpack/server-development/5.pack.gz +2 -2
  24. .next/cache/webpack/server-development/6.pack.gz +2 -2
  25. .next/cache/webpack/server-development/7.pack.gz +2 -2
  26. .next/cache/webpack/server-development/9.pack.gz +2 -2
  27. .next/cache/webpack/server-development/index.pack.gz +2 -2
  28. .next/cache/webpack/server-development/index.pack.gz.old +0 -0
  29. .next/server/app-paths-manifest.json +2 -1
  30. .next/server/middleware-build-manifest.js +1 -1
  31. .next/server/pages-manifest.json +1 -5
  32. .next/static/development/_buildManifest.js +1 -1
  33. .next/trace +0 -0
  34. app/api/route.ts +26 -0
  35. assets/.DS_Store +0 -0
  36. 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:f6afffd78d99646dfdcb901d41ef337e33087b7dd06cc05902a7af805ddea636
3
- size 2420
 
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:a42a783ebdba243a4bbd23cc6fd6b8c9dbdc2e34b4675f4baef184e0af435712
3
- size 3498
 
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:574d6a0699e13e7ace5e10fae3e1541aed383025d90e1b38e04823b412decf90
3
- size 1429
 
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:9857266a1b5a327a2ef3be4667d74678793de7c719dfe2b0062c1547241c149f
3
- size 7474915
 
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:21d032bdd0bc8ee94ce7511bf3d9530fde05dc990b98fad162ca0b0ff0191650
3
- size 24528
 
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:6cd7eb4e8ea6bc122d399e6f31e65fce98fd95d4286a55ac53a58d30e2a98ae1
3
- size 9955483
 
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:34af9d97b1618c1db4a1bfb8f1e73a1c341dc3d0730e104e8c066f0b410ae385
3
- size 17215
 
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:80b7a026552212e47ea53d3b84633bc3dffbe9bc318a2e6ef421fd5ad1e202d2
3
- size 4318
 
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:cc173317e33fbdac23535225f26c99f3f16806d7e7ee523796ef294e86d6d7c7
3
- size 201483
 
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:b00bcf3f158cd6e349ebd0c7c72d6974a4e4e1cf433708fca1a1cb647ed5db75
3
- size 5281
 
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:162690c86b2c7aa36b8d152ae2d666398dbf6f30a041678d45010890c1342c04
3
- size 232873
 
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:a67eaf32aa7e0d72da5435ed543d504515efb2bbb20c7feb8d631781e0174409
3
- size 64265
 
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:29ff2dfb4f961dbda026648c7addde01092fd87bafcfd6b6ddfcbf7e6f48a7c5
3
- size 1772669
 
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:889eea0b47e951afeeec79c8b3c4402985e6adb87468f47a7595335341119868
3
- size 7868
 
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:c796849c1be4f2d97ee02d4bac268cbf98f461bb036b3bf80646a1f7532c1cbe
3
- size 4556
 
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:52e3a0f639689cf10b7090ea25a834c5f355df6e6f40d09fa4da5cc4e30d9b94
3
- size 3139889
 
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:ce59824710f50196f276361ff4bbfaebf6dc9e03437951a6d3966d2be4df8617
3
- size 13771
 
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:043df0e98b64ed377b6725af5e43b65523ba9de7a0be9ed859217baee9e92dbd
3
- size 1220
 
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:2a108bd4fa63b22cb85dd93d918510b6d3b4ab0c3a79dd7f787acb24a0830a5f
3
- size 2343
 
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:a57ea957f94a8fe806bd7c28afe23e197e25482305efd821e0bfd7477f77eb29
3
- size 5342
 
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:4f123d7b94b3bb43a951b238932c28a4158914aa2f5d79bfd58a5c2b8d06dc38
3
- size 3173279
 
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:f2490a0cb88b9836527a89755071331e715fb87c8bdb6fdb33c6f5a0fe56f989
3
- size 1637613
 
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:25bf819f76ca895e9dd5214a474b5e286c691ab2cec3c34f6168ac3ad1f4f09c
3
- size 13091
 
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:f74305ec845b4db271d37beb74b8828793c29b99a9e1f39175d6ce5eeadb4ebe
3
- size 3613
 
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:c1ea094ac8f5137c504de93d6ad223152773f1341d10d6a8252491b43bc82ed7
3
- size 128287
 
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":["static/chunks/react-refresh.js"],"ampDevFiles":[],"lowPriorityFiles":["static/development/_buildManifest.js","static/development/_ssgManifest.js"],"rootMainFiles":["static/chunks/webpack.js","static/chunks/main-app.js"],"pages":{"/_app":["static/chunks/webpack.js","static/chunks/main.js","static/chunks/pages/_app.js"],"/_error":["static/chunks/webpack.js","static/chunks/main.js","static/chunks/pages/_error.js"]},"ampFirstPages":[]}
 
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:[]},"/_error":["static\u002Fchunks\u002Fpages\u002F_error.js"],sortedPages:["\u002F_app","\u002F_error"]};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()
 
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
- 'https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0',
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((res) => console.log(res))
 
 
 
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)