Spaces:
Runtime error
Runtime error
Upload 4 files
Browse files- app.py +6 -3
- loras.json +22 -14
- mod.py +10 -3
- requirements.txt +3 -2
app.py
CHANGED
@@ -104,6 +104,9 @@ def update_selection(evt: gr.SelectData, width, height):
|
|
104 |
elif selected_lora["aspect"] == "landscape":
|
105 |
width = 1024
|
106 |
height = 768
|
|
|
|
|
|
|
107 |
return (
|
108 |
gr.update(placeholder=new_placeholder),
|
109 |
updated_text,
|
@@ -324,7 +327,7 @@ with gr.Blocks(theme='Nymbo/Nymbo_Theme', fill_width=True, css=css) as app:
|
|
324 |
with gr.Column(scale=1, elem_id="gen_column"):
|
325 |
generate_button = gr.Button("Generate", variant="primary", elem_id="gen_btn")
|
326 |
with gr.Row():
|
327 |
-
with gr.Column(
|
328 |
selected_info = gr.Markdown("")
|
329 |
gallery = gr.Gallery(
|
330 |
[(item["image"], item["title"]) for item in loras],
|
@@ -339,7 +342,7 @@ with gr.Blocks(theme='Nymbo/Nymbo_Theme', fill_width=True, css=css) as app:
|
|
339 |
custom_lora_info = gr.HTML(visible=False)
|
340 |
custom_lora_button = gr.Button("Remove custom LoRA", visible=False)
|
341 |
deselect_lora_button = gr.Button("Deselect LoRA", variant="secondary")
|
342 |
-
with gr.Column(
|
343 |
result = gr.Image(label="Generated Image", format="png", show_share_button=False)
|
344 |
with gr.Group():
|
345 |
model_name = gr.Dropdown(label="Base Model", info="You can enter a huggingface model repo_id to want to use.", choices=models, value=models[0], allow_custom_value=True)
|
@@ -395,7 +398,7 @@ with gr.Blocks(theme='Nymbo/Nymbo_Theme', fill_width=True, css=css) as app:
|
|
395 |
lora_download = [None] * num_loras
|
396 |
for i in range(num_loras):
|
397 |
lora_download[i] = gr.Button(f"Get and set LoRA to {int(i+1)}")
|
398 |
-
with gr.Accordion("ControlNet (🚧Under construction...🚧)", open=False):
|
399 |
with gr.Column():
|
400 |
cn_on = gr.Checkbox(False, label="Use ControlNet")
|
401 |
cn_mode = [None] * num_cns
|
|
|
104 |
elif selected_lora["aspect"] == "landscape":
|
105 |
width = 1024
|
106 |
height = 768
|
107 |
+
else:
|
108 |
+
width = 1024
|
109 |
+
height = 1024
|
110 |
return (
|
111 |
gr.update(placeholder=new_placeholder),
|
112 |
updated_text,
|
|
|
327 |
with gr.Column(scale=1, elem_id="gen_column"):
|
328 |
generate_button = gr.Button("Generate", variant="primary", elem_id="gen_btn")
|
329 |
with gr.Row():
|
330 |
+
with gr.Column():
|
331 |
selected_info = gr.Markdown("")
|
332 |
gallery = gr.Gallery(
|
333 |
[(item["image"], item["title"]) for item in loras],
|
|
|
342 |
custom_lora_info = gr.HTML(visible=False)
|
343 |
custom_lora_button = gr.Button("Remove custom LoRA", visible=False)
|
344 |
deselect_lora_button = gr.Button("Deselect LoRA", variant="secondary")
|
345 |
+
with gr.Column():
|
346 |
result = gr.Image(label="Generated Image", format="png", show_share_button=False)
|
347 |
with gr.Group():
|
348 |
model_name = gr.Dropdown(label="Base Model", info="You can enter a huggingface model repo_id to want to use.", choices=models, value=models[0], allow_custom_value=True)
|
|
|
398 |
lora_download = [None] * num_loras
|
399 |
for i in range(num_loras):
|
400 |
lora_download[i] = gr.Button(f"Get and set LoRA to {int(i+1)}")
|
401 |
+
with gr.Accordion("ControlNet (🚧Under construction...🚧)", open=False, visible=False):
|
402 |
with gr.Column():
|
403 |
cn_on = gr.Checkbox(False, label="Use ControlNet")
|
404 |
cn_mode = [None] * num_cns
|
loras.json
CHANGED
@@ -27,6 +27,13 @@
|
|
27 |
"weights": "ovld_style_overlord_wavymulder.safetensors",
|
28 |
"trigger_word": ", ovld style anime"
|
29 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
{
|
31 |
"image": "https://huggingface.co/multimodalart/flux-tarot-v1/resolve/main/images/e5f2761e5d474e6ba492d20dca0fa26f_e78f1524074b42b6ac49643ffad50ac6.png",
|
32 |
"title": "Tarot v1",
|
@@ -47,19 +54,6 @@
|
|
47 |
"trigger_word": "RU883R style",
|
48 |
"trigger_position": "prepend"
|
49 |
},
|
50 |
-
{
|
51 |
-
"image": "https://huggingface.co/mgwr/Cine-Aesthetic/resolve/main/images/00030-1333633802.png",
|
52 |
-
"title": "Cine Aesthetic",
|
53 |
-
"repo": "mgwr/Cine-Aesthetic",
|
54 |
-
"trigger_word": "mgwr/cine",
|
55 |
-
"trigger_position": "prepend"
|
56 |
-
},
|
57 |
-
{
|
58 |
-
"image": "https://huggingface.co/Shakker-Labs/FLUX.1-dev-LoRA-blended-realistic-illustration/resolve/main/images/example3.png",
|
59 |
-
"title": "Blended Realistic Illustration",
|
60 |
-
"repo": "Shakker-Labs/FLUX.1-dev-LoRA-blended-realistic-illustration",
|
61 |
-
"trigger_word": "artistic style blends reality and illustration elements"
|
62 |
-
},
|
63 |
{
|
64 |
"image": "https://github.com/XLabs-AI/x-flux/blob/main/assets/readme/examples/picture-6-rev1.png?raw=true",
|
65 |
"title": "flux-Realism",
|
@@ -73,6 +67,13 @@
|
|
73 |
"trigger_word": "a vintage ad of",
|
74 |
"trigger_position": "prepend"
|
75 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
{
|
77 |
"image": "https://huggingface.co/nerijs/animation2k-flux/resolve/main/images/Q8-oVxNnXvZ9HNrgbNpGw_02762aaaba3b47859ee5fe9403a371e3.png",
|
78 |
"title": "animation2k",
|
@@ -89,7 +90,14 @@
|
|
89 |
"image": "https://huggingface.co/veryVANYA/ps1-style-flux/resolve/main/24439220.jpeg",
|
90 |
"title": "PS1 style",
|
91 |
"repo": "veryVANYA/ps1-style-flux",
|
92 |
-
"trigger_word": "ps1 game screenshot"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
},
|
94 |
{
|
95 |
"image": "https://huggingface.co/alvdansen/flux-koda/resolve/main/images/ComfyUI_00566_%20(2).png",
|
|
|
27 |
"weights": "ovld_style_overlord_wavymulder.safetensors",
|
28 |
"trigger_word": ", ovld style anime"
|
29 |
},
|
30 |
+
{
|
31 |
+
"image": "https://huggingface.co/Norod78/JojosoStyle-flux-lora/resolve/main/samples/1725244218477__000004255_1.jpg",
|
32 |
+
"title": "JoJo's Bizarre Adventure: Stone Ocean ",
|
33 |
+
"repo": "Norod78/JojosoStyle-flux-lora",
|
34 |
+
"weights": "JojosoStyle_flux_lora.safetensors",
|
35 |
+
"trigger_word": ", JojosoStyle"
|
36 |
+
},
|
37 |
{
|
38 |
"image": "https://huggingface.co/multimodalart/flux-tarot-v1/resolve/main/images/e5f2761e5d474e6ba492d20dca0fa26f_e78f1524074b42b6ac49643ffad50ac6.png",
|
39 |
"title": "Tarot v1",
|
|
|
54 |
"trigger_word": "RU883R style",
|
55 |
"trigger_position": "prepend"
|
56 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
{
|
58 |
"image": "https://github.com/XLabs-AI/x-flux/blob/main/assets/readme/examples/picture-6-rev1.png?raw=true",
|
59 |
"title": "flux-Realism",
|
|
|
67 |
"trigger_word": "a vintage ad of",
|
68 |
"trigger_position": "prepend"
|
69 |
},
|
70 |
+
{
|
71 |
+
"image": "https://huggingface.co/mgwr/Cine-Aesthetic/resolve/main/images/00030-1333633802.png",
|
72 |
+
"title": "Cine Aesthetic",
|
73 |
+
"repo": "mgwr/Cine-Aesthetic",
|
74 |
+
"trigger_word": "mgwr/cine",
|
75 |
+
"trigger_position": "prepend"
|
76 |
+
},
|
77 |
{
|
78 |
"image": "https://huggingface.co/nerijs/animation2k-flux/resolve/main/images/Q8-oVxNnXvZ9HNrgbNpGw_02762aaaba3b47859ee5fe9403a371e3.png",
|
79 |
"title": "animation2k",
|
|
|
90 |
"image": "https://huggingface.co/veryVANYA/ps1-style-flux/resolve/main/24439220.jpeg",
|
91 |
"title": "PS1 style",
|
92 |
"repo": "veryVANYA/ps1-style-flux",
|
93 |
+
"trigger_word": "ps1 game screenshot,",
|
94 |
+
"trigger_position": "prepend"
|
95 |
+
},
|
96 |
+
{
|
97 |
+
"image": "https://huggingface.co/Shakker-Labs/FLUX.1-dev-LoRA-blended-realistic-illustration/resolve/main/images/example3.png",
|
98 |
+
"title": "Blended Realistic Illustration",
|
99 |
+
"repo": "Shakker-Labs/FLUX.1-dev-LoRA-blended-realistic-illustration",
|
100 |
+
"trigger_word": "artistic style blends reality and illustration elements"
|
101 |
},
|
102 |
{
|
103 |
"image": "https://huggingface.co/alvdansen/flux-koda/resolve/main/images/ComfyUI_00566_%20(2).png",
|
mod.py
CHANGED
@@ -29,7 +29,7 @@ models = [
|
|
29 |
"John6666/niji56-style-v3-fp8-flux",
|
30 |
"John6666/lyh-dalle-anime-v12dalle-fp8-flux",
|
31 |
"John6666/glimmerkin-flux-cute-v10-fp8-flux",
|
32 |
-
"John6666/xe-anime-flux-
|
33 |
"John6666/xe-figure-flux-01-fp8-flux",
|
34 |
"John6666/xe-pixel-flux-01-fp8-flux",
|
35 |
"John6666/fluxunchained-artfulnsfw-fut516xfp8e4m3fnv11-fp8-flux",
|
@@ -43,6 +43,7 @@ models = [
|
|
43 |
"John6666/jib-mix-flux-v208stephyper-fp8-flux",
|
44 |
"John6666/flux-asian-realistic-v10-fp8-flux",
|
45 |
"John6666/fluxasiandoll-v10-fp8-flux",
|
|
|
46 |
"John6666/fluxescore-dev-v10fp16-fp8-flux",
|
47 |
# "",
|
48 |
]
|
@@ -73,8 +74,13 @@ def is_repo_exists(repo_id):
|
|
73 |
|
74 |
|
75 |
def clear_cache():
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
|
80 |
def deselect_lora():
|
@@ -345,3 +351,4 @@ load_prompt_enhancer.zerogpu = True
|
|
345 |
fuse_loras.zerogpu = True
|
346 |
preprocess_image.zerogpu = True
|
347 |
get_control_params.zerogpu = True
|
|
|
|
29 |
"John6666/niji56-style-v3-fp8-flux",
|
30 |
"John6666/lyh-dalle-anime-v12dalle-fp8-flux",
|
31 |
"John6666/glimmerkin-flux-cute-v10-fp8-flux",
|
32 |
+
"John6666/xe-anime-flux-03-fp8-flux",
|
33 |
"John6666/xe-figure-flux-01-fp8-flux",
|
34 |
"John6666/xe-pixel-flux-01-fp8-flux",
|
35 |
"John6666/fluxunchained-artfulnsfw-fut516xfp8e4m3fnv11-fp8-flux",
|
|
|
43 |
"John6666/jib-mix-flux-v208stephyper-fp8-flux",
|
44 |
"John6666/flux-asian-realistic-v10-fp8-flux",
|
45 |
"John6666/fluxasiandoll-v10-fp8-flux",
|
46 |
+
"John6666/xe-asian-flux-01-fp8-flux",
|
47 |
"John6666/fluxescore-dev-v10fp16-fp8-flux",
|
48 |
# "",
|
49 |
]
|
|
|
74 |
|
75 |
|
76 |
def clear_cache():
|
77 |
+
try:
|
78 |
+
torch.cuda.empty_cache()
|
79 |
+
#torch.cuda.reset_max_memory_allocated()
|
80 |
+
torch.cuda.reset_peak_memory_stats()
|
81 |
+
gc.collect()
|
82 |
+
except Exception as e:
|
83 |
+
print(e)
|
84 |
|
85 |
|
86 |
def deselect_lora():
|
|
|
351 |
fuse_loras.zerogpu = True
|
352 |
preprocess_image.zerogpu = True
|
353 |
get_control_params.zerogpu = True
|
354 |
+
clear_cache.zerogpu = True
|
requirements.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
spaces
|
2 |
git+https://github.com/huggingface/diffusers
|
3 |
-
torch
|
4 |
torchvision
|
5 |
huggingface_hub
|
6 |
accelerate
|
@@ -9,9 +9,10 @@ peft
|
|
9 |
sentencepiece
|
10 |
timm
|
11 |
einops
|
12 |
-
|
13 |
kornia
|
14 |
numpy
|
15 |
opencv-python
|
16 |
deepspeed
|
|
|
17 |
openai==1.37.0
|
|
|
1 |
spaces
|
2 |
git+https://github.com/huggingface/diffusers
|
3 |
+
torch==2.2.0
|
4 |
torchvision
|
5 |
huggingface_hub
|
6 |
accelerate
|
|
|
9 |
sentencepiece
|
10 |
timm
|
11 |
einops
|
12 |
+
controlnet_aux
|
13 |
kornia
|
14 |
numpy
|
15 |
opencv-python
|
16 |
deepspeed
|
17 |
+
mediapipe
|
18 |
openai==1.37.0
|