Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -27,211 +27,212 @@ def query(prompt, model, custom_lora, is_negative=False, steps=35, cfg_scale=7,
|
|
27 |
prompt = f"{prompt} | ultra detail, ultra elaboration, ultra quality, perfect."
|
28 |
print(f'Generation {key}: {prompt}')
|
29 |
|
30 |
-
# Set API URL based on model selection
|
31 |
try:
|
|
|
32 |
if custom_lora.strip():
|
33 |
API_URL = f"https://api-inference.huggingface.co/models/{custom_lora.strip()}"
|
34 |
else:
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
|
|
235 |
|
236 |
# Prepare payload
|
237 |
payload = {
|
@@ -267,6 +268,9 @@ def query(prompt, model, custom_lora, is_negative=False, steps=35, cfg_scale=7,
|
|
267 |
except Exception as e:
|
268 |
raise gr.Error(f"Unexpected error: {str(e)}")
|
269 |
|
|
|
|
|
|
|
270 |
def generate_grid(prompt, selected_models, custom_lora, negative_prompt, steps, cfg_scale, seed, strength, width, height, progress=gr.Progress()):
|
271 |
if len(selected_models) > 4:
|
272 |
raise gr.Error("Please select up to 4 models")
|
|
|
27 |
prompt = f"{prompt} | ultra detail, ultra elaboration, ultra quality, perfect."
|
28 |
print(f'Generation {key}: {prompt}')
|
29 |
|
|
|
30 |
try:
|
31 |
+
# Set API URL based on model selection
|
32 |
if custom_lora.strip():
|
33 |
API_URL = f"https://api-inference.huggingface.co/models/{custom_lora.strip()}"
|
34 |
else:
|
35 |
+
if model == 'Stable Diffusion XL':
|
36 |
+
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
|
37 |
+
elif model == 'FLUX.1 [Dev]':
|
38 |
+
API_URL = "https://api-inference.huggingface.co/models/black-forest-labs/FLUX.1-dev"
|
39 |
+
elif model == 'FLUX.1 [Schnell]':
|
40 |
+
API_URL = "https://api-inference.huggingface.co/models/black-forest-labs/FLUX.1-schnell"
|
41 |
+
elif model == 'Flux Logo Design':
|
42 |
+
API_URL = "https://api-inference.huggingface.co/models/Shakker-Labs/FLUX.1-dev-LoRA-Logo-Design"
|
43 |
+
prompt = f"wablogo, logo, Minimalist, {prompt}"
|
44 |
+
elif model == 'Flux Uncensored':
|
45 |
+
API_URL = "https://api-inference.huggingface.co/models/enhanceaiteam/Flux-uncensored"
|
46 |
+
elif model == 'Flux Uncensored V2':
|
47 |
+
API_URL = "https://api-inference.huggingface.co/models/enhanceaiteam/Flux-Uncensored-V2"
|
48 |
+
elif model == 'Flux Tarot Cards':
|
49 |
+
API_URL = "https://api-inference.huggingface.co/models/prithivMLmods/Ton618-Tarot-Cards-Flux-LoRA"
|
50 |
+
prompt = f"Tarot card, {prompt}"
|
51 |
+
elif model == 'Pixel Art Sprites':
|
52 |
+
API_URL = "https://api-inference.huggingface.co/models/sWizad/pokemon-trainer-sprites-pixelart-flux"
|
53 |
+
prompt = f"a pixel image, {prompt}"
|
54 |
+
elif model == '3D Sketchfab':
|
55 |
+
API_URL = "https://api-inference.huggingface.co/models/prithivMLmods/Castor-3D-Sketchfab-Flux-LoRA"
|
56 |
+
prompt = f"3D Sketchfab, {prompt}"
|
57 |
+
elif model == 'Retro Comic Flux':
|
58 |
+
API_URL = "https://api-inference.huggingface.co/models/renderartist/retrocomicflux"
|
59 |
+
prompt = f"c0m1c, comic book panel, {prompt}"
|
60 |
+
elif model == 'Caricature':
|
61 |
+
API_URL = "https://api-inference.huggingface.co/models/TheAwakenOne/caricature"
|
62 |
+
prompt = f"CCTUR3, {prompt}"
|
63 |
+
elif model == 'Huggieverse':
|
64 |
+
API_URL = "https://api-inference.huggingface.co/models/Chunte/flux-lora-Huggieverse"
|
65 |
+
prompt = f"HGGRE, {prompt}"
|
66 |
+
elif model == 'Propaganda Poster':
|
67 |
+
API_URL = "https://api-inference.huggingface.co/models/AlekseyCalvin/Propaganda_Poster_Schnell_by_doctor_diffusion"
|
68 |
+
prompt = f"propaganda poster, {prompt}"
|
69 |
+
elif model == 'Flux Game Assets V2':
|
70 |
+
API_URL = "https://api-inference.huggingface.co/models/gokaygokay/Flux-Game-Assets-LoRA-v2"
|
71 |
+
prompt = f"wbgmsst, white background, {prompt}"
|
72 |
+
elif model == 'SoftPasty Flux':
|
73 |
+
API_URL = "https://api-inference.huggingface.co/models/alvdansen/softpasty-flux-dev"
|
74 |
+
prompt = f"araminta_illus illustration style, {prompt}"
|
75 |
+
elif model == 'Flux Stickers':
|
76 |
+
API_URL = "https://api-inference.huggingface.co/models/diabolic6045/Flux_Sticker_Lora"
|
77 |
+
prompt = f"5t1cker 5ty1e, {prompt}"
|
78 |
+
elif model == 'Flux Animex V2':
|
79 |
+
API_URL = "https://api-inference.huggingface.co/models/strangerzonehf/Flux-Animex-v2-LoRA"
|
80 |
+
prompt = f"Animex, {prompt}"
|
81 |
+
elif model == 'Flux Animeo V1':
|
82 |
+
API_URL = "https://api-inference.huggingface.co/models/strangerzonehf/Flux-Animeo-v1-LoRA"
|
83 |
+
prompt = f"Animeo, {prompt}"
|
84 |
+
elif model == 'Movie Board':
|
85 |
+
API_URL = "https://api-inference.huggingface.co/models/prithivMLmods/Flux.1-Dev-Movie-Boards-LoRA"
|
86 |
+
prompt = f"movieboard, {prompt}"
|
87 |
+
elif model == 'Purple Dreamy':
|
88 |
+
API_URL = "https://api-inference.huggingface.co/models/prithivMLmods/Purple-Dreamy-Flux-LoRA"
|
89 |
+
prompt = f"Purple Dreamy, {prompt}"
|
90 |
+
elif model == 'PS1 Style Flux':
|
91 |
+
API_URL = "https://api-inference.huggingface.co/models/veryVANYA/ps1-style-flux"
|
92 |
+
prompt = f"ps1 game screenshot, {prompt}"
|
93 |
+
elif model == 'Softserve Anime':
|
94 |
+
API_URL = "https://api-inference.huggingface.co/models/alvdansen/softserve_anime"
|
95 |
+
prompt = f"sftsrv style illustration, {prompt}"
|
96 |
+
elif model == 'Flux Tarot v1':
|
97 |
+
API_URL = "https://api-inference.huggingface.co/models/multimodalart/flux-tarot-v1"
|
98 |
+
prompt = f"in the style of TOK a trtcrd tarot style, {prompt}"
|
99 |
+
elif model == 'Half Illustration':
|
100 |
+
API_URL = "https://api-inference.huggingface.co/models/davisbro/half_illustration"
|
101 |
+
prompt = f"in the style of TOK, {prompt}"
|
102 |
+
elif model == 'OpenDalle v1.1':
|
103 |
+
API_URL = "https://api-inference.huggingface.co/models/dataautogpt3/OpenDalleV1.1"
|
104 |
+
elif model == 'Flux Ghibsky Illustration':
|
105 |
+
API_URL = "https://api-inference.huggingface.co/models/aleksa-codes/flux-ghibsky-illustration"
|
106 |
+
prompt = f"GHIBSKY style, {prompt}"
|
107 |
+
elif model == 'Flux Koda':
|
108 |
+
API_URL = "https://api-inference.huggingface.co/models/alvdansen/flux-koda"
|
109 |
+
prompt = f"flmft style, {prompt}"
|
110 |
+
elif model == 'Soviet Diffusion XL':
|
111 |
+
API_URL = "https://api-inference.huggingface.co/models/openskyml/soviet-diffusion-xl"
|
112 |
+
prompt = f"soviet poster, {prompt}"
|
113 |
+
elif model == 'Flux Realism LoRA':
|
114 |
+
API_URL = "https://api-inference.huggingface.co/models/XLabs-AI/flux-RealismLora"
|
115 |
+
elif model == 'Frosting Lane Flux':
|
116 |
+
API_URL = "https://api-inference.huggingface.co/models/alvdansen/frosting_lane_flux"
|
117 |
+
prompt = f"frstingln illustration, {prompt}"
|
118 |
+
elif model == 'Phantasma Anime':
|
119 |
+
API_URL = "https://api-inference.huggingface.co/models/alvdansen/phantasma-anime"
|
120 |
+
elif model == 'Boreal':
|
121 |
+
API_URL = "https://api-inference.huggingface.co/models/kudzueye/Boreal"
|
122 |
+
prompt = f"photo, {prompt}"
|
123 |
+
elif model == 'How2Draw':
|
124 |
+
API_URL = "https://api-inference.huggingface.co/models/glif/how2draw"
|
125 |
+
prompt = f"How2Draw, {prompt}"
|
126 |
+
elif model == 'Flux AestheticAnime':
|
127 |
+
API_URL = "https://api-inference.huggingface.co/models/dataautogpt3/FLUX-AestheticAnime"
|
128 |
+
elif model == 'Fashion Hut Modeling LoRA':
|
129 |
+
API_URL = "https://api-inference.huggingface.co/models/prithivMLmods/Fashion-Hut-Modeling-LoRA"
|
130 |
+
prompt = f"Modeling of, {prompt}"
|
131 |
+
elif model == 'Flux SyntheticAnime':
|
132 |
+
API_URL = "https://api-inference.huggingface.co/models/dataautogpt3/FLUX-SyntheticAnime"
|
133 |
+
prompt = f"1980s anime screengrab, VHS quality, syntheticanime, {prompt}"
|
134 |
+
elif model == 'Flux Midjourney Anime':
|
135 |
+
API_URL = "https://api-inference.huggingface.co/models/brushpenbob/flux-midjourney-anime"
|
136 |
+
prompt = f"egmid, {prompt}"
|
137 |
+
elif model == 'Coloring Book Generator':
|
138 |
+
API_URL = "https://api-inference.huggingface.co/models/robert123231/coloringbookgenerator"
|
139 |
+
elif model == 'Collage Flux':
|
140 |
+
API_URL = "https://api-inference.huggingface.co/models/prithivMLmods/Castor-Collage-Dim-Flux-LoRA"
|
141 |
+
prompt = f"collage, {prompt}"
|
142 |
+
elif model == 'Flux Product Ad Backdrop':
|
143 |
+
API_URL = "https://api-inference.huggingface.co/models/prithivMLmods/Flux-Product-Ad-Backdrop"
|
144 |
+
prompt = f"Product Ad, {prompt}"
|
145 |
+
elif model == 'Product Design':
|
146 |
+
API_URL = "https://api-inference.huggingface.co/models/multimodalart/product-design"
|
147 |
+
prompt = f"product designed by prdsgn, {prompt}"
|
148 |
+
elif model == '90s Anime Art':
|
149 |
+
API_URL = "https://api-inference.huggingface.co/models/glif/90s-anime-art"
|
150 |
+
elif model == 'Brain Melt Acid Art':
|
151 |
+
API_URL = "https://api-inference.huggingface.co/models/glif/Brain-Melt-Acid-Art"
|
152 |
+
prompt = f"maximalism, in an acid surrealism style, {prompt}"
|
153 |
+
elif model == 'Lustly Flux Uncensored v1':
|
154 |
+
API_URL = "https://api-inference.huggingface.co/models/lustlyai/Flux_Lustly.ai_Uncensored_nsfw_v1"
|
155 |
+
elif model == 'NSFW Master Flux':
|
156 |
+
API_URL = "https://api-inference.huggingface.co/models/Keltezaa/NSFW_MASTER_FLUX"
|
157 |
+
prompt = f"NSFW, {prompt}"
|
158 |
+
elif model == 'Flux Outfit Generator':
|
159 |
+
API_URL = "https://api-inference.huggingface.co/models/tryonlabs/FLUX.1-dev-LoRA-Outfit-Generator"
|
160 |
+
elif model == 'Midjourney':
|
161 |
+
API_URL = "https://api-inference.huggingface.co/models/Jovie/Midjourney"
|
162 |
+
elif model == 'DreamPhotoGASM':
|
163 |
+
API_URL = "https://api-inference.huggingface.co/models/Yntec/DreamPhotoGASM"
|
164 |
+
elif model == 'Flux Super Realism LoRA':
|
165 |
+
API_URL = "https://api-inference.huggingface.co/models/strangerzonehf/Flux-Super-Realism-LoRA"
|
166 |
+
elif model == 'Stable Diffusion 2-1':
|
167 |
+
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-2-1-base"
|
168 |
+
elif model == 'Stable Diffusion 3.5 Large':
|
169 |
+
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-3.5-large"
|
170 |
+
elif model == 'Stable Diffusion 3.5 Large Turbo':
|
171 |
+
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-3.5-large-turbo"
|
172 |
+
elif model == 'Stable Diffusion 3 Medium':
|
173 |
+
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-3-medium-diffusers"
|
174 |
+
prompt = f"A, {prompt}"
|
175 |
+
elif model == 'Duchaiten Real3D NSFW XL':
|
176 |
+
API_URL = "https://api-inference.huggingface.co/models/stablediffusionapi/duchaiten-real3d-nsfw-xl"
|
177 |
+
elif model == 'Pixel Art XL':
|
178 |
+
API_URL = "https://api-inference.huggingface.co/models/nerijs/pixel-art-xl"
|
179 |
+
prompt = f"pixel art, {prompt}"
|
180 |
+
elif model == 'Character Design':
|
181 |
+
API_URL = "https://api-inference.huggingface.co/models/KappaNeuro/character-design"
|
182 |
+
prompt = f"Character Design, {prompt}"
|
183 |
+
elif model == 'Sketched Out Manga':
|
184 |
+
API_URL = "https://api-inference.huggingface.co/models/alvdansen/sketchedoutmanga"
|
185 |
+
prompt = f"daiton, {prompt}"
|
186 |
+
elif model == 'Archfey Anime':
|
187 |
+
API_URL = "https://api-inference.huggingface.co/models/alvdansen/archfey_anime"
|
188 |
+
elif model == 'Lofi Cuties':
|
189 |
+
API_URL = "https://api-inference.huggingface.co/models/alvdansen/lofi-cuties"
|
190 |
+
elif model == 'YiffyMix':
|
191 |
+
API_URL = "https://api-inference.huggingface.co/models/Yntec/YiffyMix"
|
192 |
+
elif model == 'Analog Madness Realistic v7':
|
193 |
+
API_URL = "https://api-inference.huggingface.co/models/digiplay/AnalogMadness-realistic-model-v7"
|
194 |
+
elif model == 'Selfie Photography':
|
195 |
+
API_URL = "https://api-inference.huggingface.co/models/artificialguybr/selfiephotographyredmond-selfie-photography-lora-for-sdxl"
|
196 |
+
prompt = f"instagram model, discord profile picture, {prompt}"
|
197 |
+
elif model == 'Filmgrain':
|
198 |
+
API_URL = "https://api-inference.huggingface.co/models/artificialguybr/filmgrain-redmond-filmgrain-lora-for-sdxl"
|
199 |
+
prompt = f"Film Grain, FilmGrainAF, {prompt}"
|
200 |
+
elif model == 'Leonardo AI Style Illustration':
|
201 |
+
API_URL = "https://api-inference.huggingface.co/models/goofyai/Leonardo_Ai_Style_Illustration"
|
202 |
+
prompt = f"leonardo style, illustration, vector art, {prompt}"
|
203 |
+
elif model == 'Cyborg Style XL':
|
204 |
+
API_URL = "https://api-inference.huggingface.co/models/goofyai/cyborg_style_xl"
|
205 |
+
prompt = f"cyborg style, {prompt}"
|
206 |
+
elif model == 'Little Tinies':
|
207 |
+
API_URL = "https://api-inference.huggingface.co/models/alvdansen/littletinies"
|
208 |
+
elif model == 'NSFW XL':
|
209 |
+
API_URL = "https://api-inference.huggingface.co/models/Dremmar/nsfw-xl"
|
210 |
+
elif model == 'Analog Redmond':
|
211 |
+
API_URL = "https://api-inference.huggingface.co/models/artificialguybr/analogredmond"
|
212 |
+
prompt = f"timeless style, {prompt}"
|
213 |
+
elif model == 'Pixel Art Redmond':
|
214 |
+
API_URL = "https://api-inference.huggingface.co/models/artificialguybr/PixelArtRedmond"
|
215 |
+
prompt = f"Pixel Art, {prompt}"
|
216 |
+
elif model == 'Ascii Art':
|
217 |
+
API_URL = "https://api-inference.huggingface.co/models/CiroN2022/ascii-art"
|
218 |
+
prompt = f"ascii art, {prompt}"
|
219 |
+
elif model == 'Analog':
|
220 |
+
API_URL = "https://api-inference.huggingface.co/models/Yntec/Analog"
|
221 |
+
elif model == 'Maple Syrup':
|
222 |
+
API_URL = "https://api-inference.huggingface.co/models/Yntec/MapleSyrup"
|
223 |
+
elif model == 'Perfect Lewd Fantasy':
|
224 |
+
API_URL = "https://api-inference.huggingface.co/models/digiplay/perfectLewdFantasy_v1.01"
|
225 |
+
elif model == 'AbsoluteReality 1.8.1':
|
226 |
+
API_URL = "https://api-inference.huggingface.co/models/digiplay/AbsoluteReality_v1.8.1"
|
227 |
+
elif model == 'Disney':
|
228 |
+
API_URL = "https://api-inference.huggingface.co/models/goofyai/disney_style_xl"
|
229 |
+
prompt = f"Disney style, {prompt}"
|
230 |
+
elif model == 'Redmond SDXL':
|
231 |
+
API_URL = "https://api-inference.huggingface.co/models/artificialguybr/LogoRedmond-LogoLoraForSDXL-V2"
|
232 |
+
elif model == 'epiCPhotoGasm':
|
233 |
+
API_URL = "https://api-inference.huggingface.co/models/Yntec/epiCPhotoGasm"
|
234 |
+
else:
|
235 |
+
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
|
236 |
|
237 |
# Prepare payload
|
238 |
payload = {
|
|
|
268 |
except Exception as e:
|
269 |
raise gr.Error(f"Unexpected error: {str(e)}")
|
270 |
|
271 |
+
|
272 |
+
|
273 |
+
|
274 |
def generate_grid(prompt, selected_models, custom_lora, negative_prompt, steps, cfg_scale, seed, strength, width, height, progress=gr.Progress()):
|
275 |
if len(selected_models) > 4:
|
276 |
raise gr.Error("Please select up to 4 models")
|