Spaces:
Runtime error
Runtime error
Commit
·
b486453
1
Parent(s):
a07adce
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import random
|
3 |
+
|
4 |
+
def generate_image(prompt):
|
5 |
+
faces = [
|
6 |
+
"https://avatars.mds.yandex.net/i?id=f9676dc9c99572353c509d298a0b9f6571edca4e-10514707-images-thumbs&n=13",
|
7 |
+
"https://avatars.mds.yandex.net/i?id=e02f3f0a7cab6ae7eba3b1209ba9d56dcc24715a-7552414-images-thumbs&n=13",
|
8 |
+
"https://avatars.mds.yandex.net/i?id=aa883402ff70aa4c6d77441e3b2f3fb85483a047-5480663-images-thumbs&n=13",
|
9 |
+
"https://avatars.mds.yandex.net/i?id=30ae3f522a50aea82e7c61444656a259dbc106af-7823046-images-thumbs&n=13",
|
10 |
+
"https://avatars.mds.yandex.net/i?id=0ffd2b2d3d6927fdd824ce3af649bdc2827bc72c-10092505-images-thumbs&n=13"
|
11 |
+
]
|
12 |
+
|
13 |
+
landscapes = [
|
14 |
+
"https://avatars.mds.yandex.net/i?id=d817020d4f33ce8dd5f012ec14b46026230f7f38-4304379-images-thumbs&n=13",
|
15 |
+
"https://avatars.mds.yandex.net/i?id=0c44f37e0f3240a7f873ade37dbf77d87be8d3a0-9103996-images-thumbs&n=13",
|
16 |
+
"https://avatars.mds.yandex.net/i?id=54432591615e90e906f554b6deb6a33ae47e56b0-7551636-images-thumbs&n=13",
|
17 |
+
"https://avatars.mds.yandex.net/i?id=ef1792a7e82c70fb5a12c0b159c061b31c1c2461-9237918-images-thumbs&n=13",
|
18 |
+
"https://avatars.mds.yandex.net/i?id=e2639ee50941423c94aab655b416c8e1db84a015-9712020-images-thumbs&n=13"
|
19 |
+
]
|
20 |
+
|
21 |
+
animals = [
|
22 |
+
"https://avatars.mds.yandex.net/i?id=a1a7b590d43b39c427304b03c180802c-5714596-images-thumbs&n=13",
|
23 |
+
"https://avatars.mds.yandex.net/i?id=4da68929c18e73e06c2332018658f2f344f4e56e-8567697-images-thumbs&n=13",
|
24 |
+
"https://avatars.mds.yandex.net/i?id=c4000087b8d4c591d887a3d21f25a76738cb3d21-5880141-images-thumbs&n=13",
|
25 |
+
"https://avatars.mds.yandex.net/i?id=d507afc55fdbef5d6c51aa82acbf2d06211b79d8-7051980-images-thumbs&n=13",
|
26 |
+
"https://avatars.mds.yandex.net/i?id=52bfb5b4c8638c1c5feecf49797240d0e4128425-9181120-images-thumbs&n=13"
|
27 |
+
]
|
28 |
+
|
29 |
+
car = [
|
30 |
+
"https://avatars.mds.yandex.net/i?id=4b8a4a2285b409371e8b45060db83d522fd7e3a8-9624682-images-thumbs&n=13",
|
31 |
+
"https://avatars.mds.yandex.net/i?id=5583a40b92d72bbaacd0726f5b7504b5bb41ec4f-8264916-images-thumbs&n=13",
|
32 |
+
"https://avatars.mds.yandex.net/i?id=f2bf530d35b3eb1e4a50db12a3f6347fca90504a-9609067-images-thumbs&n=13",
|
33 |
+
"https://avatars.mds.yandex.net/i?id=fa0f8f3c6411a8122be313df6c8adcf7d389d3c6-7552082-images-thumbs&n=13",
|
34 |
+
"https://avatars.mds.yandex.net/i?id=93519c6b3adf47b03313c2a325eb51e75018eeaa-10332876-images-thumbs&n=13"
|
35 |
+
]
|
36 |
+
|
37 |
+
food = [
|
38 |
+
"https://avatars.mds.yandex.net/i?id=aa2854aebae7aad2c9c84f9ca556823076924800-6974903-images-thumbs&n=13",
|
39 |
+
"https://avatars.mds.yandex.net/i?id=c9b4d7e1c5991af6efdc61d3a3f5b91c7b5790b8-5229803-images-thumbs&n=13",
|
40 |
+
"https://avatars.mds.yandex.net/i?id=f4ba649ad0017b1a8ad1bdba4c0b523e-4290971-images-thumbs&n=13",
|
41 |
+
"https://avatars.mds.yandex.net/i?id=045887a75bb76213d556631a67a27ce7c9df7b81-9716553-images-thumbs&n=13",
|
42 |
+
"https://avatars.mds.yandex.net/i?id=4b8a4a2285b409371e8b45060db83d522fd7e3a8-9624682-images-thumbs&n=13"
|
43 |
+
]
|
44 |
+
|
45 |
+
boat = [
|
46 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT7uC_XzpcX5FOfoPiKG-OR3O9-gTgRQ97t5dTW9kCtSKNRJ6Oz6J8fav5um1U&s",
|
47 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRDzZkpmyutasQm5JmkcwFCJ964i1SaShl5uZ2JWVysTJ-USU-m2g4jnGCJ3A&s",
|
48 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTIHj-QBEXroe_P-t8PVd7hVlA_XeQT2O9emiDb2dDODwOKU3GJM3XAo0BiLP8&s",
|
49 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRN_7Cg8g0GR0pHIsWlC6zucsVad6GJQeoxjZuCC6NtEYSi6iN3PD_oOqgMCs0&s",
|
50 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQbO69SuDBUWRxPmSaMvY9tUzvN3CPDGy6Qy7Ws88jgNHXtLDMJAv9dTYPKYbo&s"
|
51 |
+
]
|
52 |
+
|
53 |
+
logo = [
|
54 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSzDj5UHlSMn4JnM-LU1lDI5Gj8IyXoUGcPJFUW2L9g4ud_A2DEaCBVAlupLnE&s",
|
55 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQuEVbV_xtLzMDbVj9Hqfet_JoN7-L0uTflNS9szF9nxWWYtEiGrMnA4H_59EQ&s",
|
56 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS9m3Ifv2-Gqjlq6q2YefVARxit9uQYXVvrFkCXhXF2xvFxQoY2iFUCjRPBwA&s",
|
57 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQtS6eh12jeaQA5bVBKL-Vs2bbeUVE6i9i05-5qGjL6WyrSG-ipgR1x41DB49w&s",
|
58 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRxVnmLkyBugPNPiUPbE91e8M6hNm8MprUyECSMO_FrJ49maB-1AYvVBeI10fI&s"
|
59 |
+
]
|
60 |
+
|
61 |
+
eye = [
|
62 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRWYbVL4JZbaW2lRAFGhFw22TU2m1qpVjc8o7Z0PCGkOG3--FLJbwv_Errvwg&s",
|
63 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRaSR6_WMsGOAfItkCMiFxNgXKmAZVOhsAH0yI-0cuecvH8SnbJZIw2t2VfwQ&s",
|
64 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQvJagN3MtIQPzKjextKbUHtF5Km_R5JXIPSq4LY8stLtCzrLHJhtCcXpiXpXo&s",
|
65 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRLHok8H8zbsX5Oupg5DJBxLcp6Tm6LAg4S0gJ3o5lpbXYeNm5j36sWI8DX1Q&s",
|
66 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT5a0d5jgLm6lOMHIFTC5NN0Bea6EItJJPo5mNa3oX5dwMf7dwDjoTW1SogTu0&s"
|
67 |
+
]
|
68 |
+
|
69 |
+
beard = [
|
70 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTiJOMp_SLFTOUXZCz9ssycWmh5Sn2WpE0AfIfnVdpooNqnqDT0n_gcpyzeMA&s",
|
71 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRO4dmmQnmxAP3_0AUBH031bbk-YMWnQNMIhEUxz6LV4JdPZ5ic0B3WhnEpXw&s",
|
72 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQpzFdwz_l57Nkuz089OMl8rZiKvr6zVLeyMbaQOTEKRk2e7Hgwr2tkCIkwsQ&s",
|
73 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSWFIOd5jPEVlc6hll0oyF3rbcOAWxAi8OF-BnCxAaCQBWWQDG_La69bmOm_g&s",
|
74 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTQO-zriw-KQA6JNr-Wg2vzlsd-JJBoAoDclFuEJ900j01XuMFpN0qB_QbJ5Hc&s"
|
75 |
+
]
|
76 |
+
|
77 |
+
avatar = [
|
78 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQhoGkHKK-mUcbSGNLNw_zM_vSGD5axZmiysJiKHz62-S1j61KVUypKeRZ6Jw&s",
|
79 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRpbv3vxSrrCksivuHDtAO7dZylFj0YoeB3xZ8ujV37046chtdbOlXQJNBuSg&s",
|
80 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSrD3u82KvAmb2sNdU5An5HTgr8uJAVHyD7878tdxoBtf8M_oBvKV1x5zDFmn8&s",
|
81 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRHKrlqz4evD_YlQqhwq6cCW5x6XkMxLZb4mFTqkuNTBe4hQCSBUa_KFIqWnw&s",
|
82 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSZknN5zWQt0C6vzbTjL2XkU0BZthLv0zUgrKoSyTgEO_5FeyVSl4oiSPKUWQI&s"
|
83 |
+
]
|
84 |
+
|
85 |
+
dreadlocks= [
|
86 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSJAdKXK3VacgTY6Slf3wYALB7d1yMfilkpYAMe4wwXmWq3uXCi981Kka5_bfE&s",
|
87 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTqpcvYkiKXkkEd7x2udV87zj4SXC60hwuzcqF9yHkRpPGh-nUwEPzqSGJwGQ&s",
|
88 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ6DPaqOivnFuLovOI_TuUWxfkLj4z9BmlFcvAhN2PEYBs9EAJdNEW1EDLBmS8&s",
|
89 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQM4hIEP519ofGPZPv3ZwvaZBElD2dZL1AFWmtwvNlHaxMX1ndew80eZ_bWWiM&s",
|
90 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSD8ReWbLVONl2rqPCSzVrl1UHCy92gC06Opfekhe1kvkvPiKPY9zRK_XT5fA&s"
|
91 |
+
]
|
92 |
+
|
93 |
+
soap = [
|
94 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRsgzD0uRzqZVq84N7upWTqLuf0UUBKVPrdlBFbYFtAJloSIsUogh6vEZEAnQ&s",
|
95 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTsfiDc8JlSL9f3Hchjp_kJ90BlbIlqzOKh1x8-cU7vBvqtVhp2MtOvkSMHGy4&s",
|
96 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQI0pzIuoZKeAhh0SkC6HOVFion1tkeGQbFwZ_vLZCNewuz22oWiEuHV7N8Ww&s",
|
97 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSIwxtneQ0cWI4W-vR3l6aPg6ngJc1A368AKUufCaP4s3Sf6meK-Gjb7WuPBg&s",
|
98 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRYazRp7i1fSoqCC0fTHi7NbIGnFhXkJQvKFZJ1WkticD0zjG_P5UK6KoaKDw&s"
|
99 |
+
]
|
100 |
+
|
101 |
+
sumsung= [
|
102 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRCPcaCaH1iV4CxGtCM2QiE9k2rxDJAwLB1q9RjmKeI11YuKRZV97FMyN7TGUA&s",
|
103 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ_lK5kondU1fLYopOzhs35c7O9895dQEg7ZA4f_tWwKoyg-D5K9BBgOsiK2A&s",
|
104 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTdnE_U-MyUYNQuu3AItAc6sjN3QOHbsuN6igd06jkkW_72IWLgpgZBYDhmPO4&s",
|
105 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTSpo9Rk0bHp6zz1RINp4zXPvxOJpcxHwiVHCWhG4WnQbixaW2da2GOzrdE4Kk&s",
|
106 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRk73Acil1EDstNwJROXJ2kyvYjyI_wCab_mWsS5Vm09-9uyXLNd277QGd0aTE&s"
|
107 |
+
]
|
108 |
+
|
109 |
+
phone = [
|
110 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR4oq8P-XORyX_g-oQz4yiXotJO85q0PDYbRo7rWbnt3nwklHocAOPXXARGU7I&s",
|
111 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRqZMzmeDwvUyDmG5x0y586u9v_PqefKcRd8DlLI3pk8YA3FPJoHHDhWQJO7w&s",
|
112 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRwRQ4guGOZ3gYLngSIPqhsnKAPUuoBmTz-54klXS_kDMd5p8CDjMqXOaVeouU&s",
|
113 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTKaO7EQrR2zSN2thcH9qBROWIpxe6bGEc0m_F4BFiUAt8FzsfulbPhdhWaog&s",
|
114 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQjsQYj_Ut9gpKFHImQJvSXd9HD31PZEumBqKohwyLFKCNlK1wCQuo6F9dAgIc&s"
|
115 |
+
]
|
116 |
+
|
117 |
+
iphone = [
|
118 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRnsbZqd6WXaneQDuWE54UDgLMcwyeWRu45G0G3BarzaNETVacPsc4fnYtISQ&s",
|
119 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQBPSTHkYe2UTr1VtpPJqt1j_9GwTtCQaPoMKv5-lWz2-hwp18WUuhI9qZ2WeE&s",
|
120 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSZQDa7mSYdE8ngeICK5WBg0UYsHdkJ5dVrxUi03qIud5tgiic2NL_ta93OJPc&s",
|
121 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSFslO464O0WgNa4JME2M5ODR9lyxebh5SbY6RMzw9RTCOTcuYfz5FCkvsCsOc&s",
|
122 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRgINKzd2do0Gq92Ze_9Z2vRE42-mgyJUxbZnq7VclmrPzFmXr6j_eFDyxsfEk&s"
|
123 |
+
]
|
124 |
+
|
125 |
+
code = [
|
126 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR8AQUUNCiFvhqKIAbomE0Oi8klATjRW1_OIDaxnvsBfgpGcbDNEgPtAI7Cow&s",
|
127 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQQVswifdUmIkjvImbXIzkEGZBKjukPCpslWapX3XZ8yKuqzis_103p2kfqwjk&s",
|
128 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ8F2fRUA43Jv0kDPFlfiP70Xvuje5X-xBrsv8jLHRjBZCrls2WT6lKb3OJ9P4&s",
|
129 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT93F2GIUYF1fI9bHZ3O3qyg8obIPn_OAjWc0HPKbCcTFtzSYOVg8QwxoW3bUY&s",
|
130 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQHVOT4zPTgvgrxvJhHbGUWYwwkfwyg7-Laj1HmXk7L7hNsAy15-mkAz9W0zQw&s"
|
131 |
+
]
|
132 |
+
|
133 |
+
ytlogo = [
|
134 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcROoysKpwbXlY2M4z6wSfH1n4CiNGWI4sQ052sz8wPZB6zgQp2FELDFEmb4D-4&s",
|
135 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRGT0bDOiIfqKI-UsX_o85KYMF7GXqecDlI3pFe8qeWDRUB7DiT2pBiQky-kQ&s",
|
136 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRpln5qd4ZhvF51yhcP2Hk31wQipzlrLfEp2gpLozBCp9kLH-Csl0p6_3TA5g&s",
|
137 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQRODy1QkPYlzUbv8s-ONymnztScHTTp7pU7iIU8xo1U_HbBHAzTSl529nZ0Qg&s",
|
138 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR-ke4ykhnylaUE7cwvKJflTIron_YEv2G6djOyHy8eWNUT66ekBn_NRxeK1sk&s"
|
139 |
+
]
|
140 |
+
|
141 |
+
backrooms = [
|
142 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQL6KWuRbgabni4B5L-W1ZUoU7qWBuGeLgun1FBTYKbUrKbM3pmZl-zKfeu4gE&s",
|
143 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSdWGZ0mSyjGAzrF6NZpzp5YMCxKfwuTtQm8FgjoLtJ-BfAzNgfyFVwut0OB70&s",
|
144 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQfUa9DtjgccXhdpjhAUu9jA4r6sXlheQEwdm5CKGbkzm7UYiDHSb9Ppnj31g&s",
|
145 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ3xb2t61JY1ydKvXxE2rvhHwIoD9QpOhNc5bQAwiaKrUWJxh5nvRQ4gShIzg&s",
|
146 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSJFpQDPzCY2VrgnDyzE66l0PtsyXZwfryN7lFTy7Tt1NroElcNP-NSdvKfOg&s"
|
147 |
+
]
|
148 |
+
|
149 |
+
|
150 |
+
dog = [
|
151 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRotwetUK0NfzN-2GOk2nH6HAOcCIos85WFZRQkRxtkk-OfNgCFRivkWXKbNA&s",
|
152 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT_peU0kINinA3eXkJadJeSvejSl_5sdsl0YragpD48DY8gR-3N4lJv1MAZkg&s",
|
153 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTxc6B-rTX2W_2ebGA9yevnhaJZJpW7Njs_QIuERCnYnVv68Q53LbyEn8sjgA&s",
|
154 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS3Eihd0V74gEj-DQg7d7oWgAoewiK_o1CKS7pEhjzfg-uj7gTlE5N8GWnYwA&s",
|
155 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQRzkLbC-711Phno7wpIXPmCyCQoVtN1L5iRMgRZ2OY6HjAlUMxroPB4hh1o9k&s"
|
156 |
+
]
|
157 |
+
|
158 |
+
doll = [
|
159 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTz7ezACV5JTBS-4t62vweRIgJJtPtBocuvXWcqn2tmbdoxMoWBJisoK26EuQ&s",
|
160 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTkPI_jklNmx9mxdfBgihNUDkriHaMcNIr-wzftGGX8nJ8NuGL7-l52YDXX2Io&s",
|
161 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTZnP0N33NH6DNxn_xJKsSIjBOIDWcjqSk4vPnIyyDgC1z-TEsM0Ouo9PyKaQ&s",
|
162 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRIQwigkIJf8WxNVsgnzHBkMjKCot8qmST1ZO-XXVn-5Q-2oP4IjU21epQtPw&s",
|
163 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSAaBAWGR8xL_Ds3O3zU3gpPm2nFGkZka6QMoRQclEDxoabOM1axtcN1DyYqg&s"
|
164 |
+
]
|
165 |
+
|
166 |
+
background = [
|
167 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTk6eYuzpiGwpQzrLGyMInzUQH8rLMi-tJ-CgO3jzE7EwjMuPhCbD-Izg4c8g&s",
|
168 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTlfc5dgbFAWBpzXUqqG8XpFp0ChXGhizw4te7p5gdN2JN39uk75qfJSsyGzA&s",
|
169 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTy7tvvh3-1rWQ5p6DKl-X0-Ch-hwWcRS0Gz3hlSSva0701dLWc4QpPamuho20&s",
|
170 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTJmfreu3ua18h8EcArDD_jzoLMXWKOgOnBROtzThALjeqMWEOAa4oz_gn_fk8&s",
|
171 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR7i4xPXauC7fC6R4gz8TgcQCPkqwAg2olTPDgSOFm3i3FLLxD8Xf9uFg5BZOs&s"
|
172 |
+
]
|
173 |
+
|
174 |
+
gold_robot = [
|
175 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ6fOQe7D-zsr_TBymoLoyK5l30OeW4plpVc_oUeClzqGuCbbfkU1ESKkloKUg&s",
|
176 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTPyWunhkGAw5d3SaEV6gS6NT4ASOrG6A99TA-dQGd9fQwX1aQqhKrJpgReEWs&s",
|
177 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTyQTzY1WDfsUHy0qlR6Gw7XPvXJH3fQyT7ynECg_xQxL-hQbhq7OmmXcxBPlc&s",
|
178 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRh2Vya7ab5AdihcJ7k6NtNyCoTv_S2uNgZ7i40OCCEFJIWGUGcj_DvppmOyw&s",
|
179 |
+
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ22ZuyrA2M6ezgdOKsUzhFjjsckZUacogWsQsPELvBC7BXElUxz4fCYmK2kEc&s"
|
180 |
+
]
|
181 |
+
|
182 |
+
if "face" in prompt:
|
183 |
+
output = random.choice(faces)
|
184 |
+
return output
|
185 |
+
elif "landscape" in prompt:
|
186 |
+
output = random.choice(landscapes)
|
187 |
+
return output
|
188 |
+
elif "animal" in prompt:
|
189 |
+
output = random.choice(animal)
|
190 |
+
return output
|
191 |
+
elif "car" in prompt:
|
192 |
+
output = random.choice(car)
|
193 |
+
return output
|
194 |
+
elif "food" in prompt:
|
195 |
+
output = random.choice(food)
|
196 |
+
return output
|
197 |
+
elif "boat" in prompt:
|
198 |
+
output = random.choice(boat)
|
199 |
+
return output
|
200 |
+
elif "logo" in prompt:
|
201 |
+
output = random.choice(logo)
|
202 |
+
return output
|
203 |
+
elif "eye" in prompt:
|
204 |
+
output = random.choice(eye)
|
205 |
+
return output
|
206 |
+
elif "food" in prompt:
|
207 |
+
output = random.choice(food)
|
208 |
+
return output
|
209 |
+
elif "beard" in prompt:
|
210 |
+
output = random.choice(beard)
|
211 |
+
return output
|
212 |
+
elif "avatar" in prompt:
|
213 |
+
output = random.choice(avatar)
|
214 |
+
return output
|
215 |
+
elif "dreadlocks" in prompt:
|
216 |
+
output = random.choice(dreadlocks)
|
217 |
+
return output
|
218 |
+
elif "soap" in prompt:
|
219 |
+
output = random.choice(soap)
|
220 |
+
return output
|
221 |
+
elif "sumsung" in prompt:
|
222 |
+
output = random.choice(sumsung)
|
223 |
+
return output
|
224 |
+
elif "iphone" in prompt:
|
225 |
+
output = random.choice(iphone)
|
226 |
+
return output
|
227 |
+
elif "phone" in prompt:
|
228 |
+
output = random.choice(phone)
|
229 |
+
return output
|
230 |
+
elif "code" in prompt:
|
231 |
+
output = random.choice(code)
|
232 |
+
return output
|
233 |
+
elif "youtube" in prompt:
|
234 |
+
output = random.choice(ytlogo)
|
235 |
+
return output
|
236 |
+
elif "dog" in prompt:
|
237 |
+
output = random.choice(dog)
|
238 |
+
return output
|
239 |
+
elif "doll" in prompt:
|
240 |
+
output = random.choice(doll)
|
241 |
+
return output
|
242 |
+
elif "background" in prompt:
|
243 |
+
output = random.choice(background)
|
244 |
+
return output
|
245 |
+
elif "gold robot" in prompt:
|
246 |
+
output = random.choice(gold_robot)
|
247 |
+
return output
|
248 |
+
else:
|
249 |
+
return "No image generated."
|
250 |
+
|
251 |
+
iface = gr.Interface(
|
252 |
+
fn=generate_image,
|
253 |
+
inputs=gr.inputs.Textbox(label="Enter prompt"),
|
254 |
+
outputs="text",
|
255 |
+
title="KVIImager 2.0 - Image Generator",
|
256 |
+
description="Generate images based on a prompt.\n AI is trained by KVI Kontent by 1300 images\n SO it maybe don't understand your promt currectly",
|
257 |
+
examples=[["I want an image"], ["No image please"]]
|
258 |
+
)
|
259 |
+
|
260 |
+
iface.launch()
|