K00B404 commited on
Commit
cd7d1ac
·
verified ·
1 Parent(s): bfeb0e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +146 -18
app.py CHANGED
@@ -47,7 +47,7 @@ def generate_character_description(character_prompt, system_message = """
47
 
48
  # Function to enable LoRA if selected
49
  def enable_lora(lora_add, basemodel):
50
- print(f"[-] Menentukan model: LoRA {'diaktifkan' if lora_add else 'tidak diaktifkan'}, model dasar: {basemodel}")
51
  return basemodel if not lora_add else lora_add
52
 
53
  # Function to generate image
@@ -117,7 +117,7 @@ async def gen(prompt, basemodel, width, height, scales, steps, seed, upscale_fac
117
  print(f"[-] Proses upscaling selesai. Gambar tersimpan di: {upscale_image_path}")
118
  return [image_path, upscale_image_path] # Return both images
119
  else:
120
- print("[-] Upscaling gagal, jalur gambar upscale tidak ditemukan.")
121
 
122
  return [image_path]
123
 
@@ -151,7 +151,134 @@ css = """
151
  color: silver;
152
  }
153
  """
154
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  # Creating Gradio interface
156
  with gr.Blocks(css=css, theme=IndonesiaTheme()) as WallpaperFluxMaker:
157
  # Displaying the application title
@@ -167,27 +294,28 @@ with gr.Blocks(css=css, theme=IndonesiaTheme()) as WallpaperFluxMaker:
167
  # Column 1: Input prompt, LoRA, and base model
168
  with gr.Column(scale=1, elem_id="col-left"):
169
  prompt = gr.Textbox(
170
- label="📜 Deskripsi Gambar",
171
- placeholder="Tuliskan prompt Anda dalam bahasa apapun, yang akan langsung diterjemahkan ke bahasa Inggris.",
172
  elem_id="textbox-prompt"
173
  )
174
 
175
  basemodel_choice = gr.Dropdown(
176
- label="🖼️ Pilih Model",
177
  choices=[
178
  "black-forest-labs/FLUX.1-schnell",
179
  "black-forest-labs/FLUX.1-DEV",
180
  "enhanceaiteam/Flux-uncensored",
181
  "Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro",
182
  "Shakker-Labs/FLUX.1-dev-LoRA-add-details",
183
- "city96/FLUX.1-dev-gguf"
 
184
  ],
185
  value="black-forest-labs/FLUX.1-schnell"
186
  )
187
 
188
  lora_model_choice = gr.Dropdown(
189
- label="🎨 Pilih LoRA",
190
- choices=[
191
  "Shakker-Labs/FLUX.1-dev-LoRA-add-details",
192
  "XLabs-AI/flux-RealismLora",
193
  "prashanth970/flux-lora-uncensored"
@@ -195,21 +323,21 @@ with gr.Blocks(css=css, theme=IndonesiaTheme()) as WallpaperFluxMaker:
195
  value="XLabs-AI/flux-RealismLora"
196
  )
197
 
198
- process_lora = gr.Checkbox(label="🎨 Aktifkan LoRA")
199
- process_upscale = gr.Checkbox(label="🔍 Aktifkan Peningkatan Resolusi")
200
- upscale_factor = gr.Radio(label="🔍 Faktor Peningkatan Resolusi", choices=[2, 4, 8], value=2)
201
 
202
  # Column 2: Advanced options (always open)
203
  with gr.Column(scale=1, elem_id="col-right"):
204
- with gr.Accordion(label="⚙️ Opsi Lanjutan", open=True):
205
- width = gr.Slider(label="Lebar", minimum=512, maximum=1280, step=8, value=1280)
206
- height = gr.Slider(label="Tinggi", minimum=512, maximum=1280, step=8, value=768)
207
- scales = gr.Slider(label="Skala", minimum=1, maximum=20, step=1, value=8)
208
- steps = gr.Slider(label="Langkah", minimum=1, maximum=100, step=1, value=8)
209
  seed = gr.Number(label="Seed", value=-1)
210
 
211
  # Button to generate image
212
- btn = gr.Button("🚀 Buat Gambar", elem_id="generate-btn")
213
 
214
  # Running the `gen` function when "Generate" button is pressed
215
  btn.click(fn=gen, inputs=[
 
47
 
48
  # Function to enable LoRA if selected
49
  def enable_lora(lora_add, basemodel):
50
+ print(f"[-] Determining the model: LoRA {'activated' if lora_add else 'not activated'}, model dasar: {basemodel}")
51
  return basemodel if not lora_add else lora_add
52
 
53
  # Function to generate image
 
117
  print(f"[-] Proses upscaling selesai. Gambar tersimpan di: {upscale_image_path}")
118
  return [image_path, upscale_image_path] # Return both images
119
  else:
120
+ print("[-] Upscaling failed, upscale image path not found")
121
 
122
  return [image_path]
123
 
 
151
  color: silver;
152
  }
153
  """
154
+ flux_lora_models = [
155
+ "strangerzonehf/Flux-Super-Realism-LoRA",
156
+ "prithivMLmods/Flux-Dalle-Mix-LoRA",
157
+ "strangerzonehf/Flux-Animeo-v1-LoRA",
158
+ "strangerzonehf/Flux-Animex-v2-LoRA",
159
+ "strangerzonehf/Flux-Super-Portrait-LoRA",
160
+ "strangerzonehf/Flux-Super-Blend-LoRA",
161
+ "strangerzonehf/Flux-3DXL-Partfile-0001",
162
+ "strangerzonehf/Flux-Midjourney-Mix2-LoRA",
163
+ "prithivMLmods/Flux-Long-Toon-LoRA",
164
+ "strangerzonehf/Flux-Isometric-3D-Cinematography",
165
+ "strangerzonehf/Flux-Cute-3D-Kawaii-LoRA",
166
+ "strangerzonehf/Flux-Isometric-3D-LoRA",
167
+ "prithivMLmods/Flux-Toonic-2.5D-LoRA",
168
+ "strangerzonehf/Flux-YWL-Realism-LoRA",
169
+ "prithivMLmods/Flux-Chill-Guy-Zone",
170
+ "p1atdev/flux.1-schnell-pvc-style-lora",
171
+ "strangerzonehf/Flux-C4C-Design-LoRA",
172
+ "prithivMLmods/Purple-Dreamy-Flux-LoRA",
173
+ "prithivMLmods/Canopus-LoRA-Flux-FaceRealism",
174
+ "alvdansen/softserve_anime",
175
+ "prithivMLmods/Fashion-Hut-Modeling-LoRA",
176
+ "Shakker-Labs/FLUX.1-dev-LoRA-One-Click-Creative-Template",
177
+ "prithivMLmods/Canopus-LoRA-Flux-UltraRealism-2.0",
178
+ "gokaygokay/Flux-Game-Assets-LoRA-v2",
179
+ "alvdansen/softpasty-flux-dev",
180
+ "Shakker-Labs/FLUX.1-dev-LoRA-add-details",
181
+ "prithivMLmods/Canopus-LoRA-Flux-Anime",
182
+ "aleksa-codes/flux-ghibsky-illustration",
183
+ "Shakker-Labs/FLUX.1-dev-LoRA-Dark-Fantasy",
184
+ "Norod78/Flux_1_Dev_LoRA_Paper-Cutout-Style",
185
+ "alvdansen/mooniverse",
186
+ "alvdansen/pola-photo-flux",
187
+ "multimodalart/flux-tarot-v1",
188
+ "prithivMLmods/Flux-Dev-Real-Anime-LoRA",
189
+ "diabolic6045/Flux_Sticker_Lora",
190
+ "XLabs-AI/flux-RealismLora",
191
+ "alvdansen/flux-koda",
192
+ "mgwr/Cine-Aesthetic",
193
+ "SebastianBodza/flux_cute3D",
194
+ "bingbangboom/flux_dreamscape",
195
+ "prithivMLmods/Canopus-Cute-Kawaii-Flux-LoRA",
196
+ "Raelina/Flux-Pastel-Anime",
197
+ "Shakker-Labs/FLUX.1-dev-LoRA-Vector-Journey",
198
+ "bingbangboom/flux-miniature-worlds",
199
+ "glif-loradex-trainer/bingbangboom_flux_surf",
200
+ "prithivMLmods/Canopus-Snoopy-Charlie-Brown-Flux-LoRA",
201
+ "alvdansen/sonny-anime-fixed",
202
+ "davisbro/flux-multi-angle",
203
+ "glif/how2draw",
204
+ "Shakker-Labs/FLUX.1-dev-LoRA-Text-Poster",
205
+ "SebastianBodza/Flux_Aquarell_Watercolor_v2",
206
+ "Purz/face-projection",
207
+ "martintomov/ecom-flux-v2",
208
+ "TheAwakenOne/max-headroom",
209
+ "renderartist/toyboxflux",
210
+ "Shakker-Labs/FLUX.1-dev-LoRA-live-3D",
211
+ "Shakker-Labs/FLUX.1-dev-LoRA-Garbage-Bag-Art",
212
+ "Shakker-Labs/FLUX.1-dev-LoRA-Logo-Design",
213
+ "punzel/flux_sadie_sink",
214
+ "punzel/flux_jenna_ortega",
215
+ "Wakkamaruh/balatro-poker-cards",
216
+ "lichorosario/flux-cubist-cartoon",
217
+ "iliketoasters/miniature-people",
218
+ "ampp/rough-kids-illustrations",
219
+ "lichorosario/flux-lora-tstvctr",
220
+ "lichorosario/flux-lora-gliff-tosti-vector-no-captions-2500s",
221
+ "AlekseyCalvin/Propaganda_Poster_Schnell_by_doctor_diffusion",
222
+ "WizWhite/Wiz-PunchOut_Ringside_Portrait",
223
+ "glif-loradex-trainer/kklors_flux_dev_long_exposure",
224
+ "DamarJati/streetwear-flux",
225
+ "strangerzonehf/Flux-NTFv4-Designs-LoRA",
226
+ "multimodalart/product-design",
227
+ "prithivMLmods/Canopus-LoRA-Flux-Typography-ASCII",
228
+ "mateo-19182/mosoco",
229
+ "jakedahn/flux-latentpop",
230
+ "glif-loradex-trainer/ddickinson_dstyl3xl",
231
+ "TDN-M/RetouchFLux",
232
+ "glif/anime-blockprint-style",
233
+ "renderartist/weirdthingsflux",
234
+ "lucataco/ReplicateFluxLoRA",
235
+ "alvdansen/haunted_linework_flux",
236
+ "fofr/flux-cassette-futurism",
237
+ "Wadaka/Mojo_Style_LoRA",
238
+ "Norod78/JojosoStyle-flux-lora",
239
+ "Chunte/flux-lora-Huggieverse",
240
+ "diabolic6045/Flux_Wallpaper_Lora",
241
+ "bingbangboom/flux_geopop",
242
+ "bingbangboom/flux_colorscape",
243
+ "dvyio/flux-lora-thermal-image",
244
+ "prithivMLmods/Canopus-Clothing-Flux-LoRA",
245
+ "dvyio/flux-lora-stippled-illustration",
246
+ "wayned/fruitlabels",
247
+ "punzel/flux_margot_robbie",
248
+ "glif/Brain-Melt-Acid-Art",
249
+ "jeremytai/enso-zen",
250
+ "veryVANYA/opus-ascii-flux",
251
+ "crystantine/cybrpnkz",
252
+ "fyp1/pattern_generation",
253
+ "TheAwakenOne/caricature",
254
+ "strangerzonehf/Flux-3DXL-Partfile-C0001",
255
+ "Purz/neon-sign",
256
+ "WizWhite/wizard-s-vintage-sardine-tins",
257
+ "TheAwakenOne/mtdp-balloon-character",
258
+ "glif/golden-haggadah",
259
+ "glif-loradex-trainer/usernametaken420__oz_ftw_balaclava",
260
+ "AlloReview/flux-lora-undraw",
261
+ "Disra/lora-anime-test-02",
262
+ "wanghaofan/Black-Myth-Wukong-FLUX-LoRA",
263
+ "nerijs/pastelcomic-flux",
264
+ "RareConcepts/Flux.1-dev-LoKr-Moonman",
265
+ "martintomov/ascii-flux-v1",
266
+ "Omarito2412/Stars-Galaxy-Flux",
267
+ "brushpenbob/flux-pencil-v2",
268
+ "Shakker-Labs/FLUX.1-dev-LoRA-Children-Simple-Sketch",
269
+ "victor/contemporarink",
270
+ "wavymulder/OverlordStyleFLUX",
271
+ "marceloxp/canny-quest",
272
+ "busetolunay/building_flux_lora_v1",
273
+ "Omarito2412/Tinker-Bell-Flux",
274
+ "Shakker-Labs/FLUX.1-dev-LoRA-playful-metropolis",
275
+ "prithivMLmods/Castor-Character-Polygon-Flux-LoRA",
276
+ "prithivMLmods/Castor-Gta6-Theme-Flux-LoRA",
277
+ "prithivMLmods/Castor-Flux-Concept-Gta6-Character-Design",
278
+ "prithivMLmods/Castor-3D-Sketchfab-Flux-LoRA",
279
+ "prithivMLmods/Castor-Collage-Dim-Flux-LoRA",
280
+ "brushpenbob/flux-midjourney-anime",
281
+ ]
282
  # Creating Gradio interface
283
  with gr.Blocks(css=css, theme=IndonesiaTheme()) as WallpaperFluxMaker:
284
  # Displaying the application title
 
294
  # Column 1: Input prompt, LoRA, and base model
295
  with gr.Column(scale=1, elem_id="col-left"):
296
  prompt = gr.Textbox(
297
+ label="📜 Describe the image",
298
+ placeholder="Write your prompt in any language, and it will be directly translated into English..",
299
  elem_id="textbox-prompt"
300
  )
301
 
302
  basemodel_choice = gr.Dropdown(
303
+ label="🖼️ Select Model",
304
  choices=[
305
  "black-forest-labs/FLUX.1-schnell",
306
  "black-forest-labs/FLUX.1-DEV",
307
  "enhanceaiteam/Flux-uncensored",
308
  "Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro",
309
  "Shakker-Labs/FLUX.1-dev-LoRA-add-details",
310
+ "city96/FLUX.1-dev-gguf",
311
+ "city96/FLUX.1-schnell-gguf"
312
  ],
313
  value="black-forest-labs/FLUX.1-schnell"
314
  )
315
 
316
  lora_model_choice = gr.Dropdown(
317
+ label="🎨 Select LoRA",
318
+ choices=flux_lora_models+[
319
  "Shakker-Labs/FLUX.1-dev-LoRA-add-details",
320
  "XLabs-AI/flux-RealismLora",
321
  "prashanth970/flux-lora-uncensored"
 
323
  value="XLabs-AI/flux-RealismLora"
324
  )
325
 
326
+ process_lora = gr.Checkbox(label="🎨 Use LoRA")
327
+ process_upscale = gr.Checkbox(label="🔍 Enable Resolution Enhancement")
328
+ upscale_factor = gr.Radio(label="🔍Upscale factor", choices=[2, 4, 8], value=2)
329
 
330
  # Column 2: Advanced options (always open)
331
  with gr.Column(scale=1, elem_id="col-right"):
332
+ with gr.Accordion(label="⚙️ Advanced Options", open=True):
333
+ width = gr.Slider(label="Width", minimum=512, maximum=1280, step=8, value=1280)
334
+ height = gr.Slider(label="Height", minimum=512, maximum=1280, step=8, value=768)
335
+ scales = gr.Slider(label="Scale", minimum=1, maximum=20, step=1, value=8)
336
+ steps = gr.Slider(label="Steps", minimum=1, maximum=100, step=1, value=8)
337
  seed = gr.Number(label="Seed", value=-1)
338
 
339
  # Button to generate image
340
+ btn = gr.Button("🚀Generate Image", elem_id="generate-btn")
341
 
342
  # Running the `gen` function when "Generate" button is pressed
343
  btn.click(fn=gen, inputs=[