Spaces:
Sleeping
Sleeping
GlitchGhost
commited on
error fix done
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import random
|
|
6 |
import logging
|
7 |
import numpy as np
|
8 |
from typing import Any, Dict, List, Optional, Union
|
9 |
-
|
10 |
import torch
|
11 |
from PIL import Image
|
12 |
import gradio as gr
|
@@ -39,6 +39,7 @@ import spaces
|
|
39 |
# hf_token = 'hf-token-authentication'
|
40 |
# login(hf_token)
|
41 |
|
|
|
42 |
def calculate_shift(
|
43 |
image_seq_len,
|
44 |
base_seq_len: int = 256,
|
@@ -211,22 +212,6 @@ loras = [
|
|
211 |
"weights": "dalle-mix.safetensors",
|
212 |
"trigger_word": "dalle-mix"
|
213 |
},
|
214 |
-
#Datou1111/shou_xin
|
215 |
-
{
|
216 |
-
"image": "https://huggingface.co/strangerzonehf/Flux-Ultimate-LoRA-Collection/resolve/main/images/example_aqz3dv60n.jpeg",
|
217 |
-
"title": "SHOU_XIN",
|
218 |
-
"repo": "Datou1111/shou_xin",
|
219 |
-
"weights": "shou_xin.safetensors",
|
220 |
-
"trigger_word": "shou_xin, pencil sketch"
|
221 |
-
},
|
222 |
-
#smudge
|
223 |
-
{
|
224 |
-
"image": "https://huggingface.co/strangerzonehf/Flux-Sketch-Smudge-LoRA/resolve/main/images/5.png",
|
225 |
-
"title": "Sketch_Smudge",
|
226 |
-
"repo": "strangerzonehf/Flux-Sketch-Smudge-LoRA",
|
227 |
-
"weights": "Sketch-Smudge.safetensors",
|
228 |
-
"trigger_word": " Sketch Smudge"
|
229 |
-
},
|
230 |
#anime-v1
|
231 |
{
|
232 |
"image": "https://huggingface.co/strangerzonehf/Flux-Animeo-v1-LoRA/resolve/main/images/A4.png",
|
@@ -243,13 +228,13 @@ loras = [
|
|
243 |
"weights": "Animex.safetensors",
|
244 |
"trigger_word": "Animex"
|
245 |
},
|
246 |
-
#
|
247 |
{
|
248 |
-
"image": "https://huggingface.co/strangerzonehf/Flux-
|
249 |
-
"title": "
|
250 |
-
"repo": "strangerzonehf/Flux-
|
251 |
-
"weights": "
|
252 |
-
"trigger_word": "
|
253 |
},
|
254 |
#Super-Blend
|
255 |
{
|
@@ -259,22 +244,6 @@ loras = [
|
|
259 |
"weights": "Super-Blend.safetensors",
|
260 |
"trigger_word": "Super Blend"
|
261 |
},
|
262 |
-
#3DXL P@1
|
263 |
-
{
|
264 |
-
"image": "https://huggingface.co/strangerzonehf/Flux-3DXL-Partfile-0001/resolve/main/images/4.png",
|
265 |
-
"title": "3DXLP1",
|
266 |
-
"repo": "strangerzonehf/Flux-3DXL-Partfile-0001",
|
267 |
-
"weights": "3DXLP1.safetensors",
|
268 |
-
"trigger_word": "3DXLP1"
|
269 |
-
},
|
270 |
-
#Mixer2.0
|
271 |
-
{
|
272 |
-
"image": "https://huggingface.co/strangerzonehf/Flux-Midjourney-Mix2-LoRA/resolve/main/images/3.png",
|
273 |
-
"title": "Midjourney Mix 2",
|
274 |
-
"repo": "strangerzonehf/Flux-Midjourney-Mix2-LoRA",
|
275 |
-
"weights": "mjV6.safetensors",
|
276 |
-
"trigger_word": "MJ v6"
|
277 |
-
},
|
278 |
{
|
279 |
"image": "https://huggingface.co/prithivMLmods/Flux-Long-Toon-LoRA/resolve/main/images/LT5.png",
|
280 |
"title": "Long Toons",
|
@@ -282,6 +251,13 @@ loras = [
|
|
282 |
"weights": "Long-Toon.safetensors",
|
283 |
"trigger_word": "Long toons"
|
284 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
{
|
286 |
"image": "https://huggingface.co/strangerzonehf/Flux-Cute-3D-Kawaii-LoRA/resolve/main/images/CK3.png",
|
287 |
"title": "Cute 3D Kawaii",
|
@@ -725,7 +701,7 @@ loras = [
|
|
725 |
{
|
726 |
"image": "https://huggingface.co/strangerzonehf/Flux-NTFv4-Designs-LoRA/resolve/main/images/6.png",
|
727 |
"title": "NFT V4",
|
728 |
-
"repo": "strangerzonehf/Flux-
|
729 |
"weights": "NFTv4.safetensors",
|
730 |
"trigger_word": "NFT V4"
|
731 |
},
|
@@ -2083,6 +2059,14 @@ loras = [
|
|
2083 |
"trigger_word": "lego --fref --89890"
|
2084 |
},
|
2085 |
#223
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2086 |
{
|
2087 |
"image": "https://huggingface.co/strangerzonehf/Flux-3DXL-Partfile-0002/resolve/main/images/44.png",
|
2088 |
"title": "3DXLP2",
|
@@ -2090,7 +2074,22 @@ loras = [
|
|
2090 |
"weights": "3DXLP2.safetensors",
|
2091 |
"trigger_word": "3DXLP2"
|
2092 |
},
|
2093 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2094 |
#add new
|
2095 |
]
|
2096 |
|
@@ -2157,7 +2156,7 @@ def update_selection(evt: gr.SelectData, width, height):
|
|
2157 |
height,
|
2158 |
)
|
2159 |
|
2160 |
-
@spaces.GPU
|
2161 |
def generate_image(prompt_mash, steps, seed, cfg_scale, width, height, lora_scale, progress):
|
2162 |
pipe.to("cuda")
|
2163 |
generator = torch.Generator(device="cuda").manual_seed(seed)
|
@@ -2194,7 +2193,7 @@ def generate_image_to_image(prompt_mash, image_input_path, image_strength, steps
|
|
2194 |
).images[0]
|
2195 |
return final_image
|
2196 |
|
2197 |
-
@spaces.GPU
|
2198 |
def run_lora(prompt, image_input, image_strength, cfg_scale, steps, selected_index, randomize_seed, seed, width, height, lora_scale, progress=gr.Progress(track_tqdm=True)):
|
2199 |
if selected_index is None:
|
2200 |
raise gr.Error("You must select a LoRA before proceeding.🧨")
|
@@ -2349,7 +2348,7 @@ css = '''
|
|
2349 |
.progress-bar {height: 100%;background-color: #4f46e5;width: calc(var(--current) / var(--total) * 100%);transition: width 0.5s ease-in-out}
|
2350 |
'''
|
2351 |
|
2352 |
-
with gr.Blocks(theme="
|
2353 |
title = gr.HTML(
|
2354 |
"""<h1>FLUX LoRA DLC🥳</h1>""",
|
2355 |
elem_id="title",
|
@@ -2372,7 +2371,7 @@ with gr.Blocks(theme="YTheme/Minecraft", css=css, delete_cache=(60, 60)) as app:
|
|
2372 |
show_share_button=False
|
2373 |
)
|
2374 |
with gr.Group():
|
2375 |
-
custom_lora = gr.Textbox(label="Enter Custom LoRA", placeholder="
|
2376 |
gr.Markdown("[Check the list of FLUX LoRA's](https://huggingface.co/models?other=base_model:adapter:black-forest-labs/FLUX.1-dev)", elem_id="lora_list")
|
2377 |
custom_lora_info = gr.HTML(visible=False)
|
2378 |
custom_lora_button = gr.Button("Remove custom LoRA", visible=False)
|
|
|
6 |
import logging
|
7 |
import numpy as np
|
8 |
from typing import Any, Dict, List, Optional, Union
|
9 |
+
from diffusers.utils import load_image
|
10 |
import torch
|
11 |
from PIL import Image
|
12 |
import gradio as gr
|
|
|
39 |
# hf_token = 'hf-token-authentication'
|
40 |
# login(hf_token)
|
41 |
|
42 |
+
|
43 |
def calculate_shift(
|
44 |
image_seq_len,
|
45 |
base_seq_len: int = 256,
|
|
|
212 |
"weights": "dalle-mix.safetensors",
|
213 |
"trigger_word": "dalle-mix"
|
214 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
#anime-v1
|
216 |
{
|
217 |
"image": "https://huggingface.co/strangerzonehf/Flux-Animeo-v1-LoRA/resolve/main/images/A4.png",
|
|
|
228 |
"weights": "Animex.safetensors",
|
229 |
"trigger_word": "Animex"
|
230 |
},
|
231 |
+
#Mixer2.0
|
232 |
{
|
233 |
+
"image": "https://huggingface.co/strangerzonehf/Flux-Midjourney-Mix2-LoRA/resolve/main/images/3.png",
|
234 |
+
"title": "Midjourney Mix 2",
|
235 |
+
"repo": "strangerzonehf/Flux-Midjourney-Mix2-LoRA",
|
236 |
+
"weights": "mjV6.safetensors",
|
237 |
+
"trigger_word": "MJ v6"
|
238 |
},
|
239 |
#Super-Blend
|
240 |
{
|
|
|
244 |
"weights": "Super-Blend.safetensors",
|
245 |
"trigger_word": "Super Blend"
|
246 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
{
|
248 |
"image": "https://huggingface.co/prithivMLmods/Flux-Long-Toon-LoRA/resolve/main/images/LT5.png",
|
249 |
"title": "Long Toons",
|
|
|
251 |
"weights": "Long-Toon.safetensors",
|
252 |
"trigger_word": "Long toons"
|
253 |
},
|
254 |
+
{
|
255 |
+
"image": "https://huggingface.co/strangerzonehf/Flux-Isometric-3D-Cinematography/resolve/main/images/IS1.png",
|
256 |
+
"title": "Isometric 3D Cinematography",
|
257 |
+
"repo": "strangerzonehf/Flux-Isometric-3D-Cinematography",
|
258 |
+
"weights": "Isometric-3D-Cinematography.safetensors",
|
259 |
+
"trigger_word": "Isometric 3D Cinematography"
|
260 |
+
},
|
261 |
{
|
262 |
"image": "https://huggingface.co/strangerzonehf/Flux-Cute-3D-Kawaii-LoRA/resolve/main/images/CK3.png",
|
263 |
"title": "Cute 3D Kawaii",
|
|
|
701 |
{
|
702 |
"image": "https://huggingface.co/strangerzonehf/Flux-NTFv4-Designs-LoRA/resolve/main/images/6.png",
|
703 |
"title": "NFT V4",
|
704 |
+
"repo": "strangerzonehf/Flux-NTFv4-Designs-LoRA",
|
705 |
"weights": "NFTv4.safetensors",
|
706 |
"trigger_word": "NFT V4"
|
707 |
},
|
|
|
2059 |
"trigger_word": "lego --fref --89890"
|
2060 |
},
|
2061 |
#223
|
2062 |
+
{
|
2063 |
+
"image": "https://huggingface.co/strangerzonehf/Flux-3DXL-Partfile-0001/resolve/main/images/4.png",
|
2064 |
+
"title": "3DXLP1",
|
2065 |
+
"repo": "strangerzonehf/Flux-3DXL-Partfile-0001",
|
2066 |
+
"weights": "3DXLP1.safetensors",
|
2067 |
+
"trigger_word": "3DXLP1"
|
2068 |
+
},
|
2069 |
+
#224
|
2070 |
{
|
2071 |
"image": "https://huggingface.co/strangerzonehf/Flux-3DXL-Partfile-0002/resolve/main/images/44.png",
|
2072 |
"title": "3DXLP2",
|
|
|
2074 |
"weights": "3DXLP2.safetensors",
|
2075 |
"trigger_word": "3DXLP2"
|
2076 |
},
|
2077 |
+
#225
|
2078 |
+
{
|
2079 |
+
"image": "https://huggingface.co/strangerzonehf/Flux-3DXL-Partfile-0003/resolve/main/images/222.png",
|
2080 |
+
"title": "3DXLP3",
|
2081 |
+
"repo": "strangerzonehf/Flux-3DXL-Partfile-0003",
|
2082 |
+
"weights": "3DXLP3.safetensors",
|
2083 |
+
"trigger_word": "3DXLP3"
|
2084 |
+
},
|
2085 |
+
#226
|
2086 |
+
{
|
2087 |
+
"image": "https://huggingface.co/strangerzonehf/Flux-3DXL-Partfile-0004/resolve/main/images/3333.png",
|
2088 |
+
"title": "3DXLP4",
|
2089 |
+
"repo": "strangerzonehf/Flux-3DXL-Partfile-0004",
|
2090 |
+
"weights": "3DXLP4.safetensors",
|
2091 |
+
"trigger_word": "3DXLP4"
|
2092 |
+
}
|
2093 |
#add new
|
2094 |
]
|
2095 |
|
|
|
2156 |
height,
|
2157 |
)
|
2158 |
|
2159 |
+
@spaces.GPU
|
2160 |
def generate_image(prompt_mash, steps, seed, cfg_scale, width, height, lora_scale, progress):
|
2161 |
pipe.to("cuda")
|
2162 |
generator = torch.Generator(device="cuda").manual_seed(seed)
|
|
|
2193 |
).images[0]
|
2194 |
return final_image
|
2195 |
|
2196 |
+
@spaces.GPU
|
2197 |
def run_lora(prompt, image_input, image_strength, cfg_scale, steps, selected_index, randomize_seed, seed, width, height, lora_scale, progress=gr.Progress(track_tqdm=True)):
|
2198 |
if selected_index is None:
|
2199 |
raise gr.Error("You must select a LoRA before proceeding.🧨")
|
|
|
2348 |
.progress-bar {height: 100%;background-color: #4f46e5;width: calc(var(--current) / var(--total) * 100%);transition: width 0.5s ease-in-out}
|
2349 |
'''
|
2350 |
|
2351 |
+
with gr.Blocks(theme="prithivMLmods/Minecraft-Theme", css=css, delete_cache=(60, 60)) as app:
|
2352 |
title = gr.HTML(
|
2353 |
"""<h1>FLUX LoRA DLC🥳</h1>""",
|
2354 |
elem_id="title",
|
|
|
2371 |
show_share_button=False
|
2372 |
)
|
2373 |
with gr.Group():
|
2374 |
+
custom_lora = gr.Textbox(label="Enter Custom LoRA", placeholder="GlitchGhost/Canopus-LoRA-Flux-Anime")
|
2375 |
gr.Markdown("[Check the list of FLUX LoRA's](https://huggingface.co/models?other=base_model:adapter:black-forest-labs/FLUX.1-dev)", elem_id="lora_list")
|
2376 |
custom_lora_info = gr.HTML(visible=False)
|
2377 |
custom_lora_button = gr.Button("Remove custom LoRA", visible=False)
|