Upload 2 files
Browse files- app.py +4 -2
- loras.json +19 -7
app.py
CHANGED
@@ -43,6 +43,7 @@ last_model = models[0]
|
|
43 |
last_cn_on = False
|
44 |
#controlnet_union = FluxControlNetModel.from_pretrained(controlnet_model_union_repo, torch_dtype=dtype)
|
45 |
#controlnet = FluxMultiControlNetModel([controlnet_union])
|
|
|
46 |
|
47 |
MAX_SEED = 2**32-1
|
48 |
|
@@ -66,6 +67,7 @@ def change_base_model(repo_id: str, cn_on: bool, disable_model_cache: bool, prog
|
|
66 |
print(f"Loading model: {repo_id} / Loading ControlNet: {controlnet_model_union_repo}")
|
67 |
controlnet_union = FluxControlNetModel.from_pretrained(controlnet_model_union_repo, torch_dtype=dtype)
|
68 |
controlnet = FluxMultiControlNetModel([controlnet_union])
|
|
|
69 |
pipe = FluxControlNetPipeline.from_pretrained(repo_id, controlnet=controlnet, torch_dtype=dtype)
|
70 |
pipe_i2i = FluxControlNetImg2ImgPipeline.from_pretrained(repo_id, controlnet=controlnet, vae=None, transformer=pipe.transformer, text_encoder=pipe.text_encoder,
|
71 |
tokenizer=pipe.tokenizer, text_encoder_2=pipe.text_encoder_2, tokenizer_2=pipe.tokenizer_2, torch_dtype=dtype)
|
@@ -194,7 +196,7 @@ def generate_image_to_image(prompt_mash, image_input_path, image_strength, steps
|
|
194 |
with calculateDuration("Generating image"):
|
195 |
# Generate image
|
196 |
modes, images, scales = get_control_params()
|
197 |
-
if
|
198 |
pipe_i2i.to("cuda")
|
199 |
pipe_i2i.vae = good_vae
|
200 |
image_input = load_image(image_input_path)
|
@@ -212,7 +214,7 @@ def generate_image_to_image(prompt_mash, image_input_path, image_strength, steps
|
|
212 |
output_type="pil",
|
213 |
).images[0]
|
214 |
return final_image
|
215 |
-
else:
|
216 |
pipe_i2i.to("cuda")
|
217 |
pipe_i2i.vae = good_vae
|
218 |
image_input = load_image(image_input_path)
|
|
|
43 |
last_cn_on = False
|
44 |
#controlnet_union = FluxControlNetModel.from_pretrained(controlnet_model_union_repo, torch_dtype=dtype)
|
45 |
#controlnet = FluxMultiControlNetModel([controlnet_union])
|
46 |
+
#controlnet.config = controlnet_union.config
|
47 |
|
48 |
MAX_SEED = 2**32-1
|
49 |
|
|
|
67 |
print(f"Loading model: {repo_id} / Loading ControlNet: {controlnet_model_union_repo}")
|
68 |
controlnet_union = FluxControlNetModel.from_pretrained(controlnet_model_union_repo, torch_dtype=dtype)
|
69 |
controlnet = FluxMultiControlNetModel([controlnet_union])
|
70 |
+
controlnet.config = controlnet_union.config
|
71 |
pipe = FluxControlNetPipeline.from_pretrained(repo_id, controlnet=controlnet, torch_dtype=dtype)
|
72 |
pipe_i2i = FluxControlNetImg2ImgPipeline.from_pretrained(repo_id, controlnet=controlnet, vae=None, transformer=pipe.transformer, text_encoder=pipe.text_encoder,
|
73 |
tokenizer=pipe.tokenizer, text_encoder_2=pipe.text_encoder_2, tokenizer_2=pipe.tokenizer_2, torch_dtype=dtype)
|
|
|
196 |
with calculateDuration("Generating image"):
|
197 |
# Generate image
|
198 |
modes, images, scales = get_control_params()
|
199 |
+
if not cn_on or len(modes) == 0:
|
200 |
pipe_i2i.to("cuda")
|
201 |
pipe_i2i.vae = good_vae
|
202 |
image_input = load_image(image_input_path)
|
|
|
214 |
output_type="pil",
|
215 |
).images[0]
|
216 |
return final_image
|
217 |
+
else:
|
218 |
pipe_i2i.to("cuda")
|
219 |
pipe_i2i.vae = good_vae
|
220 |
image_input = load_image(image_input_path)
|
loras.json
CHANGED
@@ -20,13 +20,6 @@
|
|
20 |
"weights": "lora_pastel_anime_flux.safetensors",
|
21 |
"trigger_word": ""
|
22 |
},
|
23 |
-
{
|
24 |
-
"image": "https://huggingface.co/Norod78/JojosoStyle-flux-lora/resolve/main/samples/1725244218477__000004255_1.jpg",
|
25 |
-
"title": "JoJo's Bizarre Adventure: Stone Ocean ",
|
26 |
-
"repo": "Norod78/JojosoStyle-flux-lora",
|
27 |
-
"weights": "JojosoStyle_flux_lora.safetensors",
|
28 |
-
"trigger_word": ", JojosoStyle"
|
29 |
-
},
|
30 |
{
|
31 |
"image": "https://huggingface.co/prithivMLmods/Canopus-Anime-Art-Flux-LoRA/resolve/main/images/BBBB.png",
|
32 |
"title": "Canopus-Anime-Art-FluxDev-LoRA ",
|
@@ -41,6 +34,25 @@
|
|
41 |
"weights": "ovld_style_overlord_wavymulder.safetensors",
|
42 |
"trigger_word": ", ovld style anime"
|
43 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
{
|
45 |
"image": "https://huggingface.co/multimodalart/flux-tarot-v1/resolve/main/images/e5f2761e5d474e6ba492d20dca0fa26f_e78f1524074b42b6ac49643ffad50ac6.png",
|
46 |
"title": "Tarot v1",
|
|
|
20 |
"weights": "lora_pastel_anime_flux.safetensors",
|
21 |
"trigger_word": ""
|
22 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
{
|
24 |
"image": "https://huggingface.co/prithivMLmods/Canopus-Anime-Art-Flux-LoRA/resolve/main/images/BBBB.png",
|
25 |
"title": "Canopus-Anime-Art-FluxDev-LoRA ",
|
|
|
34 |
"weights": "ovld_style_overlord_wavymulder.safetensors",
|
35 |
"trigger_word": ", ovld style anime"
|
36 |
},
|
37 |
+
{
|
38 |
+
"image": "https://huggingface.co/renderartist/simplevectorflux/resolve/main/images/ComfyUI_09477_.jpeg",
|
39 |
+
"title": "Simple Vector",
|
40 |
+
"repo": "renderartist/simplevectorflux",
|
41 |
+
"trigger_word": "v3ct0r style, simple flat vector art, isolated on white bg,",
|
42 |
+
"trigger_position": "prepend"
|
43 |
+
},
|
44 |
+
{
|
45 |
+
"image": "https://huggingface.co/glif/how2draw/resolve/main/images/glif-how2draw-araminta-k-vbnvy94npt8m338r2vm02m50.jpg",
|
46 |
+
"repo": "glif/how2draw",
|
47 |
+
"trigger_word": ", How2Draw",
|
48 |
+
"title": "How2Draw"
|
49 |
+
},
|
50 |
+
{
|
51 |
+
"image": "https://huggingface.co/glif/anime-blockprint-style/resolve/main/images/glif-block-print-anime-flux-dev-araminta-k-lora-araminta-k-kbde06qyovrmvsv65ubfyhn1.jpg",
|
52 |
+
"repo": "glif/anime-blockprint-style",
|
53 |
+
"trigger_word": ", blockprint style",
|
54 |
+
"title": "Blockprint Style"
|
55 |
+
},
|
56 |
{
|
57 |
"image": "https://huggingface.co/multimodalart/flux-tarot-v1/resolve/main/images/e5f2761e5d474e6ba492d20dca0fa26f_e78f1524074b42b6ac49643ffad50ac6.png",
|
58 |
"title": "Tarot v1",
|