Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ import uuid
|
|
| 9 |
import json
|
| 10 |
import os
|
| 11 |
|
| 12 |
-
from diffusers import StableDiffusionXLPipeline, StableDiffusion3Pipeline, SD3Transformer2DModel, FlashFlowMatchEulerDiscreteScheduler
|
| 13 |
from huggingface_hub import snapshot_download
|
| 14 |
from transformers import pipeline
|
| 15 |
from peft import PeftModel
|
|
@@ -47,6 +47,10 @@ repo_default = StableDiffusionXLPipeline.from_pretrained("fluently/Fluently-XL-F
|
|
| 47 |
repo_default.load_lora_weights("ehristoforu/dalle-3-xl-v2", adapter_name="base")
|
| 48 |
repo_default.set_adapters(["base"], adapter_weights=[0.7])
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
repo_pixel = StableDiffusionXLPipeline.from_pretrained("fluently/Fluently-XL-Final", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False)
|
| 51 |
repo_pixel.load_lora_weights("artificialguybr/PixelArtRedmond", adapter_name="base")
|
| 52 |
repo_pixel.load_lora_weights("nerijs/pixel-art-xl", adapter_name="base2")
|
|
@@ -58,6 +62,7 @@ repo_pixel.set_adapters(["base", "base2"], adapter_weights=[1, 1])
|
|
| 58 |
|
| 59 |
repo_customs = {
|
| 60 |
"Default": repo_default,
|
|
|
|
| 61 |
"Realistic": StableDiffusionXLPipeline.from_pretrained("ehristoforu/Visionix-alpha", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
|
| 62 |
"Anime": StableDiffusionXLPipeline.from_pretrained("cagliostrolab/animagine-xl-3.1", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
|
| 63 |
"Pixel": repo_pixel,
|
|
@@ -94,6 +99,9 @@ def generate(input=DEFAULT_INPUT, filter_input="", negative_input=DEFAULT_NEGATI
|
|
| 94 |
if model == "Realistic":
|
| 95 |
steps_set = 25
|
| 96 |
guidance_set = 7
|
|
|
|
|
|
|
|
|
|
| 97 |
elif model == "Anime":
|
| 98 |
steps_set = 25
|
| 99 |
guidance_set = 7
|
|
|
|
| 9 |
import json
|
| 10 |
import os
|
| 11 |
|
| 12 |
+
from diffusers import DiffusionPipeline, StableDiffusionXLPipeline, StableDiffusion3Pipeline, SD3Transformer2DModel, FlashFlowMatchEulerDiscreteScheduler
|
| 13 |
from huggingface_hub import snapshot_download
|
| 14 |
from transformers import pipeline
|
| 15 |
from peft import PeftModel
|
|
|
|
| 47 |
repo_default.load_lora_weights("ehristoforu/dalle-3-xl-v2", adapter_name="base")
|
| 48 |
repo_default.set_adapters(["base"], adapter_weights=[0.7])
|
| 49 |
|
| 50 |
+
repo_turbo = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16, use_safetensors=True, add_watermarker=False, revision="refs/pr/1").to(device)
|
| 51 |
+
repo_turbo.load_lora_weights("ehristoforu/dalle-3-xl-v2", adapter_name="base")
|
| 52 |
+
repo_turbo.set_adapters(["base"], adapter_weights=[0.7])
|
| 53 |
+
|
| 54 |
repo_pixel = StableDiffusionXLPipeline.from_pretrained("fluently/Fluently-XL-Final", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False)
|
| 55 |
repo_pixel.load_lora_weights("artificialguybr/PixelArtRedmond", adapter_name="base")
|
| 56 |
repo_pixel.load_lora_weights("nerijs/pixel-art-xl", adapter_name="base2")
|
|
|
|
| 62 |
|
| 63 |
repo_customs = {
|
| 64 |
"Default": repo_default,
|
| 65 |
+
"Turbo": repo_turbo,
|
| 66 |
"Realistic": StableDiffusionXLPipeline.from_pretrained("ehristoforu/Visionix-alpha", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
|
| 67 |
"Anime": StableDiffusionXLPipeline.from_pretrained("cagliostrolab/animagine-xl-3.1", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
|
| 68 |
"Pixel": repo_pixel,
|
|
|
|
| 99 |
if model == "Realistic":
|
| 100 |
steps_set = 25
|
| 101 |
guidance_set = 7
|
| 102 |
+
if model == "Turbo":
|
| 103 |
+
steps_set = 4
|
| 104 |
+
guidance_set = 0
|
| 105 |
elif model == "Anime":
|
| 106 |
steps_set = 25
|
| 107 |
guidance_set = 7
|