Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ import uuid
|
|
9 |
import json
|
10 |
import os
|
11 |
|
|
|
12 |
from diffusers import DiffusionPipeline
|
13 |
from transformers import pipeline
|
14 |
from PIL import Image
|
@@ -48,12 +49,16 @@ repo_default.load_lora_weights("nerijs/pixel-art-xl", adapter_name="pixel_base_2
|
|
48 |
|
49 |
repo_pro = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16, use_safetensors=True, add_watermarker=False)
|
50 |
|
|
|
|
|
|
|
|
|
51 |
repo_customs = {
|
52 |
"Default": repo_default,
|
53 |
"Realistic": DiffusionPipeline.from_pretrained("ehristoforu/Visionix-alpha", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
|
54 |
"Anime": DiffusionPipeline.from_pretrained("cagliostrolab/animagine-xl-3.1", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
|
55 |
"Pixel": repo_default,
|
56 |
-
"Pro": repo_pro,
|
57 |
}
|
58 |
|
59 |
# Functions
|
@@ -92,7 +97,7 @@ def generate(input=DEFAULT_INPUT, filter_input="", negative_input=DEFAULT_NEGATI
|
|
92 |
guidance_set = 1.5
|
93 |
repo.set_adapters(["pixel_base", "pixel_base_2"], adapter_weights=[1, 1])
|
94 |
elif model == "Pro":
|
95 |
-
steps_set =
|
96 |
guidance_set = 3.5
|
97 |
else:
|
98 |
steps_set = 25
|
|
|
9 |
import json
|
10 |
import os
|
11 |
|
12 |
+
from huggingface_hub import hf_hub_download
|
13 |
from diffusers import DiffusionPipeline
|
14 |
from transformers import pipeline
|
15 |
from PIL import Image
|
|
|
49 |
|
50 |
repo_pro = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16, use_safetensors=True, add_watermarker=False)
|
51 |
|
52 |
+
repo_pro_dir = "alimama-creative/FLUX.1-Turbo-Alpha"
|
53 |
+
repo_pro_ckpt = "diffusion_pytorch_model.safetensors"
|
54 |
+
repo_pro_lora = hf_hub_download(repo_pro_dir, repo_pro_ckpt)
|
55 |
+
|
56 |
repo_customs = {
|
57 |
"Default": repo_default,
|
58 |
"Realistic": DiffusionPipeline.from_pretrained("ehristoforu/Visionix-alpha", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
|
59 |
"Anime": DiffusionPipeline.from_pretrained("cagliostrolab/animagine-xl-3.1", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
|
60 |
"Pixel": repo_default,
|
61 |
+
"Pro": repo_pro.load_lora_weights(repo_pro_lora),
|
62 |
}
|
63 |
|
64 |
# Functions
|
|
|
97 |
guidance_set = 1.5
|
98 |
repo.set_adapters(["pixel_base", "pixel_base_2"], adapter_weights=[1, 1])
|
99 |
elif model == "Pro":
|
100 |
+
steps_set = 8
|
101 |
guidance_set = 3.5
|
102 |
else:
|
103 |
steps_set = 25
|