Update app.py
Browse files
app.py
CHANGED
@@ -44,8 +44,8 @@ repo_pixel.load_lora_weights("nerijs/pixel-art-xl", adapter_name="base2")
|
|
44 |
repo_pixel.set_adapters(["base", "base2"], adapter_weights=[1, 1])
|
45 |
|
46 |
repo_large = StableDiffusionXLPipeline.from_pretrained("Corcelio/mobius", vae=vae, controlnet=controlnet, torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False)
|
47 |
-
repo_large.load_lora_weights("ehristoforu/dalle-3-xl-v2", adapter_name="base")
|
48 |
-
repo_large.set_adapters(["base"], adapter_weights=[0.7])
|
49 |
|
50 |
repo_customs = {
|
51 |
"Default": repo_default,
|
@@ -74,23 +74,31 @@ def generate(input=DEFAULT_INPUT, filter_input="", negative_input=DEFAULT_NEGATI
|
|
74 |
repo = repo_customs[model or "Default"]
|
75 |
filter_input = filter_input or ""
|
76 |
negative_input = negative_input or DEFAULT_NEGATIVE_INPUT
|
|
|
|
|
77 |
seed = get_seed(seed)
|
78 |
|
79 |
print(input, filter_input, negative_input, model, height, width, steps, guidance, number, seed)
|
80 |
-
|
81 |
if model == "Realistic":
|
82 |
-
|
83 |
-
|
84 |
elif model == "Anime":
|
85 |
-
|
86 |
-
|
87 |
elif model == "Pixel":
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
90 |
else:
|
91 |
-
|
92 |
-
|
93 |
-
|
|
|
|
|
|
|
94 |
repo.to(DEVICE)
|
95 |
|
96 |
parameters = {
|
|
|
44 |
repo_pixel.set_adapters(["base", "base2"], adapter_weights=[1, 1])
|
45 |
|
46 |
repo_large = StableDiffusionXLPipeline.from_pretrained("Corcelio/mobius", vae=vae, controlnet=controlnet, torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False)
|
47 |
+
# repo_large.load_lora_weights("ehristoforu/dalle-3-xl-v2", adapter_name="base")
|
48 |
+
# repo_large.set_adapters(["base"], adapter_weights=[0.7])
|
49 |
|
50 |
repo_customs = {
|
51 |
"Default": repo_default,
|
|
|
74 |
repo = repo_customs[model or "Default"]
|
75 |
filter_input = filter_input or ""
|
76 |
negative_input = negative_input or DEFAULT_NEGATIVE_INPUT
|
77 |
+
steps_set = steps
|
78 |
+
guidance_set = guidance
|
79 |
seed = get_seed(seed)
|
80 |
|
81 |
print(input, filter_input, negative_input, model, height, width, steps, guidance, number, seed)
|
82 |
+
|
83 |
if model == "Realistic":
|
84 |
+
steps_set = 30
|
85 |
+
guidance_set = 7
|
86 |
elif model == "Anime":
|
87 |
+
steps_set = 16
|
88 |
+
guidance_set = 7
|
89 |
elif model == "Pixel":
|
90 |
+
steps_set = 4
|
91 |
+
guidance_set = 1.5
|
92 |
+
elif model == "Large":
|
93 |
+
steps_set = 16
|
94 |
+
guidance_set = 3
|
95 |
else:
|
96 |
+
steps_set = 16
|
97 |
+
guidance_set = 3
|
98 |
+
|
99 |
+
steps = (not steps_set or steps_set < 0 and steps_set) or steps
|
100 |
+
guidance = (not guidance_set or guidance_set < 0 and guidance_set) or guidance
|
101 |
+
|
102 |
repo.to(DEVICE)
|
103 |
|
104 |
parameters = {
|