Spaces:
Runtime error
Runtime error
Esteves Enzo
commited on
Commit
·
2a63a7e
1
Parent(s):
9f407ea
frontend logic request
Browse files- .next/app-build-manifest.json +13 -1
- .next/build-manifest.json +17 -3
- .next/cache/webpack/client-development-fallback/0.pack.gz +2 -2
- .next/cache/webpack/client-development-fallback/index.pack.gz +2 -2
- .next/cache/webpack/client-development-fallback/index.pack.gz.old +0 -0
- .next/cache/webpack/client-development/1.pack.gz +2 -2
- .next/cache/webpack/client-development/10.pack.gz +2 -2
- .next/cache/webpack/client-development/11.pack.gz +2 -2
- .next/cache/webpack/client-development/12.pack.gz +2 -2
- .next/cache/webpack/client-development/13.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/9.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/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/8.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 +3 -1
- .next/server/middleware-build-manifest.js +1 -1
- .next/server/next-font-manifest.js +1 -1
- .next/server/next-font-manifest.json +1 -1
- .next/server/pages-manifest.json +5 -1
- .next/static/development/_buildManifest.js +1 -1
- .next/trace +0 -0
- assets/.DS_Store +0 -0
- components/input-generation.tsx +22 -5
- components/main/hooks/useInputGeneration.ts +38 -0
- components/main/index.tsx +13 -3
.next/app-build-manifest.json
CHANGED
@@ -1,3 +1,15 @@
|
|
1 |
{
|
2 |
-
"pages": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
}
|
|
|
1 |
{
|
2 |
+
"pages": {
|
3 |
+
"/page": [
|
4 |
+
"static/chunks/webpack.js",
|
5 |
+
"static/chunks/main-app.js",
|
6 |
+
"static/chunks/app/page.js"
|
7 |
+
],
|
8 |
+
"/layout": [
|
9 |
+
"static/chunks/webpack.js",
|
10 |
+
"static/chunks/main-app.js",
|
11 |
+
"static/css/app/layout.css",
|
12 |
+
"static/chunks/app/layout.js"
|
13 |
+
]
|
14 |
+
}
|
15 |
}
|
.next/build-manifest.json
CHANGED
@@ -2,15 +2,29 @@
|
|
2 |
"polyfillFiles": [
|
3 |
"static/chunks/polyfills.js"
|
4 |
],
|
5 |
-
"devFiles": [
|
|
|
|
|
6 |
"ampDevFiles": [],
|
7 |
"lowPriorityFiles": [
|
8 |
"static/development/_buildManifest.js",
|
9 |
"static/development/_ssgManifest.js"
|
10 |
],
|
11 |
-
"rootMainFiles": [
|
|
|
|
|
|
|
12 |
"pages": {
|
13 |
-
"/_app": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
},
|
15 |
"ampFirstPages": []
|
16 |
}
|
|
|
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",
|
11 |
"static/development/_ssgManifest.js"
|
12 |
],
|
13 |
+
"rootMainFiles": [
|
14 |
+
"static/chunks/webpack.js",
|
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 |
}
|
.next/cache/webpack/client-development-fallback/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:a317ed37906f59b05625ade73074ed37bdf841988f6d26d369c3c787f87c789d
|
3 |
+
size 11801673
|
.next/cache/webpack/client-development-fallback/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:df8598f7810823493cd7aef06315d0b9564300ae456508ea66af248cf416dd1f
|
3 |
+
size 44098
|
.next/cache/webpack/client-development-fallback/index.pack.gz.old
CHANGED
Binary files a/.next/cache/webpack/client-development-fallback/index.pack.gz.old and b/.next/cache/webpack/client-development-fallback/index.pack.gz.old differ
|
|
.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:f6afffd78d99646dfdcb901d41ef337e33087b7dd06cc05902a7af805ddea636
|
3 |
+
size 2420
|
.next/cache/webpack/client-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:fc5f14b88bb5a14976baf067a694e254c85788836f33e4f1544bf0891c6f6828
|
3 |
+
size 457122
|
.next/cache/webpack/client-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:cbd6c83761e957717a14b2a84b3fe962fa2f56cc2976477e8cf0fcfe00f5a76f
|
3 |
+
size 6104
|
.next/cache/webpack/client-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:3eea80fc6132238ea407bf75bb3a648a1b95eedf61725d4b911cabed2f4a30da
|
3 |
+
size 3636850
|
.next/cache/webpack/client-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:a9799d2852e56530610425f14a0239d49aa0398997bc9a2dbf45bd6d0551168e
|
3 |
+
size 878172
|
.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:a42a783ebdba243a4bbd23cc6fd6b8c9dbdc2e34b4675f4baef184e0af435712
|
3 |
+
size 3498
|
.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:574d6a0699e13e7ace5e10fae3e1541aed383025d90e1b38e04823b412decf90
|
3 |
+
size 1429
|
.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:9857266a1b5a327a2ef3be4667d74678793de7c719dfe2b0062c1547241c149f
|
3 |
+
size 7474915
|
.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:21d032bdd0bc8ee94ce7511bf3d9530fde05dc990b98fad162ca0b0ff0191650
|
3 |
+
size 24528
|
.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:6cd7eb4e8ea6bc122d399e6f31e65fce98fd95d4286a55ac53a58d30e2a98ae1
|
3 |
+
size 9955483
|
.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:34af9d97b1618c1db4a1bfb8f1e73a1c341dc3d0730e104e8c066f0b410ae385
|
3 |
+
size 17215
|
.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:80b7a026552212e47ea53d3b84633bc3dffbe9bc318a2e6ef421fd5ad1e202d2
|
3 |
+
size 4318
|
.next/cache/webpack/client-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:588673ea1c584663784ec3260e942d9d8154165c27f0d1526a7ee3307d5ac52b
|
3 |
+
size 5817
|
.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:cc173317e33fbdac23535225f26c99f3f16806d7e7ee523796ef294e86d6d7c7
|
3 |
+
size 201483
|
.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:b00bcf3f158cd6e349ebd0c7c72d6974a4e4e1cf433708fca1a1cb647ed5db75
|
3 |
+
size 5281
|
.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:162690c86b2c7aa36b8d152ae2d666398dbf6f30a041678d45010890c1342c04
|
3 |
+
size 232873
|
.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:a67eaf32aa7e0d72da5435ed543d504515efb2bbb20c7feb8d631781e0174409
|
3 |
+
size 64265
|
.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:29ff2dfb4f961dbda026648c7addde01092fd87bafcfd6b6ddfcbf7e6f48a7c5
|
3 |
+
size 1772669
|
.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:043df0e98b64ed377b6725af5e43b65523ba9de7a0be9ed859217baee9e92dbd
|
3 |
+
size 1220
|
.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:2a108bd4fa63b22cb85dd93d918510b6d3b4ab0c3a79dd7f787acb24a0830a5f
|
3 |
+
size 2343
|
.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:a57ea957f94a8fe806bd7c28afe23e197e25482305efd821e0bfd7477f77eb29
|
3 |
+
size 5342
|
.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:4f123d7b94b3bb43a951b238932c28a4158914aa2f5d79bfd58a5c2b8d06dc38
|
3 |
+
size 3173279
|
.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:f2490a0cb88b9836527a89755071331e715fb87c8bdb6fdb33c6f5a0fe56f989
|
3 |
+
size 1637613
|
.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:25bf819f76ca895e9dd5214a474b5e286c691ab2cec3c34f6168ac3ad1f4f09c
|
3 |
+
size 13091
|
.next/cache/webpack/server-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:1226b0385435cff5d4b8f0f291a00c1c34819a818be4753b06c3d8b01d9f8fee
|
3 |
+
size 2067928
|
.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:f74305ec845b4db271d37beb74b8828793c29b99a9e1f39175d6ce5eeadb4ebe
|
3 |
+
size 3613
|
.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:c1ea094ac8f5137c504de93d6ad223152773f1341d10d6a8252491b43bc82ed7
|
3 |
+
size 128287
|
.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 +1,3 @@
|
|
1 |
-
{
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"/page": "app/page.js"
|
3 |
+
}
|
.next/server/middleware-build-manifest.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
self.__BUILD_MANIFEST={"polyfillFiles":["static/chunks/polyfills.js"],"devFiles":[],"ampDevFiles":[],"lowPriorityFiles":["static/development/_buildManifest.js","static/development/_ssgManifest.js"],"rootMainFiles":[],"pages":{"/_app":[]},"ampFirstPages":[]}
|
|
|
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":[]}
|
.next/server/next-font-manifest.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
self.__NEXT_FONT_MANIFEST="{\"pages\":{},\"app\":{},\"appUsingSizeAdjust\":
|
|
|
1 |
+
self.__NEXT_FONT_MANIFEST="{\"pages\":{},\"app\":{\"/Users/enzo/Desktop/development/hf-fast-image-generation/app/layout\":[\"static/media/c9a5bc6a7c948fb0-s.p.woff2\"]},\"appUsingSizeAdjust\":true,\"pagesUsingSizeAdjust\":false}"
|
.next/server/next-font-manifest.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"pages":{},"app":{},"appUsingSizeAdjust":
|
|
|
1 |
+
{"pages":{},"app":{"/Users/enzo/Desktop/development/hf-fast-image-generation/app/layout":["static/media/c9a5bc6a7c948fb0-s.p.woff2"]},"appUsingSizeAdjust":true,"pagesUsingSizeAdjust":false}
|
.next/server/pages-manifest.json
CHANGED
@@ -1 +1,5 @@
|
|
1 |
-
{
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"/_app": "pages/_app.js",
|
3 |
+
"/_error": "pages/_error.js",
|
4 |
+
"/_document": "pages/_document.js"
|
5 |
+
}
|
.next/static/development/_buildManifest.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
self.__BUILD_MANIFEST = {__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},sortedPages:["\u002F_app"]};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()
|
|
|
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()
|
.next/trace
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
assets/.DS_Store
CHANGED
Binary files a/assets/.DS_Store and b/assets/.DS_Store differ
|
|
components/input-generation.tsx
CHANGED
@@ -1,17 +1,25 @@
|
|
|
|
1 |
import { useRef, useState } from "react";
|
2 |
import { HiLightBulb } from "react-icons/hi";
|
3 |
|
4 |
interface Props {
|
5 |
prompt: string;
|
|
|
6 |
onChange: (value: string) => void;
|
|
|
7 |
}
|
8 |
|
9 |
-
export const InputGeneration: React.FC<Props> = ({
|
|
|
|
|
|
|
|
|
|
|
10 |
const input = useRef<HTMLInputElement>(null);
|
11 |
|
12 |
return (
|
13 |
<div
|
14 |
-
className="bg-white rounded-full p-3 w-full max-w-xl flex items-center justify-between group transition-all duration-200 focus-within:ring-[6px] focus-within:ring-primary border-[2px] border-white focus-within:ring-opacity-40 focus-within:border-primary"
|
15 |
onClick={() => input.current?.focus()}
|
16 |
>
|
17 |
<div className="flex items-center gap-3 pl-3 w-full">
|
@@ -20,16 +28,25 @@ export const InputGeneration: React.FC<Props> = ({ prompt, onChange }) => {
|
|
20 |
ref={input}
|
21 |
value={prompt}
|
22 |
type="text"
|
23 |
-
className="h-full text-lg placeholder:text-gray-400 text-gray-900 font-medium w-full outline-none"
|
24 |
placeholder="A thug cat riding his small bike"
|
25 |
onChange={(e) => onChange(e.target.value)}
|
26 |
/>
|
27 |
</div>
|
28 |
<button
|
29 |
disabled={!prompt}
|
30 |
-
className=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
>
|
32 |
-
Generate
|
33 |
</button>
|
34 |
</div>
|
35 |
);
|
|
|
1 |
+
import classNames from "classnames";
|
2 |
import { useRef, useState } from "react";
|
3 |
import { HiLightBulb } from "react-icons/hi";
|
4 |
|
5 |
interface Props {
|
6 |
prompt: string;
|
7 |
+
loading: boolean;
|
8 |
onChange: (value: string) => void;
|
9 |
+
onSubmit: () => void;
|
10 |
}
|
11 |
|
12 |
+
export const InputGeneration: React.FC<Props> = ({
|
13 |
+
prompt,
|
14 |
+
loading,
|
15 |
+
onChange,
|
16 |
+
onSubmit,
|
17 |
+
}) => {
|
18 |
const input = useRef<HTMLInputElement>(null);
|
19 |
|
20 |
return (
|
21 |
<div
|
22 |
+
className="bg-white rounded-full p-3 w-full max-w-xl flex items-center justify-between group transition-all duration-200 focus-within:ring-[6px] focus-within:ring-primary border-[2px] border-white focus-within:ring-opacity-40 focus-within:border-primary gap-3"
|
23 |
onClick={() => input.current?.focus()}
|
24 |
>
|
25 |
<div className="flex items-center gap-3 pl-3 w-full">
|
|
|
28 |
ref={input}
|
29 |
value={prompt}
|
30 |
type="text"
|
31 |
+
className="h-full text-lg placeholder:text-gray-400 text-gray-900 font-medium w-full outline-none truncate"
|
32 |
placeholder="A thug cat riding his small bike"
|
33 |
onChange={(e) => onChange(e.target.value)}
|
34 |
/>
|
35 |
</div>
|
36 |
<button
|
37 |
disabled={!prompt}
|
38 |
+
className={classNames(
|
39 |
+
"bg-primary disabled:bg-gray-300 disabled:text-gray-500 uppercase text-white font-semibold rounded-full px-4 py-2 text-base transition-all duration-200",
|
40 |
+
{
|
41 |
+
"animate-pulse": loading,
|
42 |
+
}
|
43 |
+
)}
|
44 |
+
onClick={() => {
|
45 |
+
if (!prompt || loading) return;
|
46 |
+
onSubmit();
|
47 |
+
}}
|
48 |
>
|
49 |
+
{loading ? "Generating..." : "Generate"}
|
50 |
</button>
|
51 |
</div>
|
52 |
);
|
components/main/hooks/useInputGeneration.ts
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { useState } from "react"
|
2 |
+
|
3 |
+
export const useInputGeneration = () => {
|
4 |
+
const [prompt, setPrompt] = useState<string>('')
|
5 |
+
const [loading, setLoading] = useState<boolean>(false)
|
6 |
+
|
7 |
+
const submit = () => {
|
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)
|
27 |
+
})
|
28 |
+
})
|
29 |
+
}
|
30 |
+
|
31 |
+
return {
|
32 |
+
prompt,
|
33 |
+
setPrompt,
|
34 |
+
loading,
|
35 |
+
submit,
|
36 |
+
}
|
37 |
+
|
38 |
+
}
|
components/main/index.tsx
CHANGED
@@ -3,18 +3,22 @@
|
|
3 |
import { useState } from "react";
|
4 |
import classNames from "classnames";
|
5 |
import { motion } from "framer-motion";
|
|
|
6 |
|
7 |
import { InputGeneration } from "@/components/input-generation";
|
8 |
import { Button } from "@/components/button";
|
|
|
9 |
|
10 |
const categories = [
|
11 |
{
|
12 |
key: "community",
|
13 |
label: "Community",
|
|
|
14 |
},
|
15 |
{
|
16 |
key: "my-own",
|
17 |
label: "My own generations",
|
|
|
18 |
},
|
19 |
];
|
20 |
|
@@ -33,21 +37,27 @@ const IMAGES = [
|
|
33 |
];
|
34 |
|
35 |
export const Main = () => {
|
36 |
-
const
|
37 |
const [category, setCategory] = useState<string>("community");
|
38 |
|
39 |
return (
|
40 |
<main className="pt-6 z-[2] relative">
|
41 |
<div className="px-6 mx-auto max-w-7xl">
|
42 |
<div className="flex items-center justify-between w-full -translate-y-1/2">
|
43 |
-
<InputGeneration
|
|
|
|
|
|
|
|
|
|
|
44 |
<div className="flex items-center justify-end gap-5 w-full">
|
45 |
-
{categories.map(({ key, label }) => (
|
46 |
<Button
|
47 |
key={key}
|
48 |
theme={key !== category ? "white" : "primary"}
|
49 |
onClick={() => setCategory(key)}
|
50 |
>
|
|
|
51 |
{label}
|
52 |
</Button>
|
53 |
))}
|
|
|
3 |
import { useState } from "react";
|
4 |
import classNames from "classnames";
|
5 |
import { motion } from "framer-motion";
|
6 |
+
import { HiUserGroup, HiHeart } from "react-icons/hi2";
|
7 |
|
8 |
import { InputGeneration } from "@/components/input-generation";
|
9 |
import { Button } from "@/components/button";
|
10 |
+
import { useInputGeneration } from "./hooks/useInputGeneration";
|
11 |
|
12 |
const categories = [
|
13 |
{
|
14 |
key: "community",
|
15 |
label: "Community",
|
16 |
+
icon: <HiUserGroup className="text-2xl" />,
|
17 |
},
|
18 |
{
|
19 |
key: "my-own",
|
20 |
label: "My own generations",
|
21 |
+
icon: <HiHeart className="text-2xl" />,
|
22 |
},
|
23 |
];
|
24 |
|
|
|
37 |
];
|
38 |
|
39 |
export const Main = () => {
|
40 |
+
const { prompt, setPrompt, submit, loading } = useInputGeneration();
|
41 |
const [category, setCategory] = useState<string>("community");
|
42 |
|
43 |
return (
|
44 |
<main className="pt-6 z-[2] relative">
|
45 |
<div className="px-6 mx-auto max-w-7xl">
|
46 |
<div className="flex items-center justify-between w-full -translate-y-1/2">
|
47 |
+
<InputGeneration
|
48 |
+
prompt={prompt}
|
49 |
+
onChange={setPrompt}
|
50 |
+
onSubmit={submit}
|
51 |
+
loading={loading}
|
52 |
+
/>
|
53 |
<div className="flex items-center justify-end gap-5 w-full">
|
54 |
+
{categories.map(({ key, label, icon }) => (
|
55 |
<Button
|
56 |
key={key}
|
57 |
theme={key !== category ? "white" : "primary"}
|
58 |
onClick={() => setCategory(key)}
|
59 |
>
|
60 |
+
{icon}
|
61 |
{label}
|
62 |
</Button>
|
63 |
))}
|