Staticaliza commited on
Commit
12fc57e
·
verified ·
1 Parent(s): a1bb9aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -42,26 +42,27 @@ footer {
42
  '''
43
 
44
  repo_nsfw_classifier = pipeline("image-classification", model="Falconsai/nsfw_image_detection")
 
45
 
46
- repo_default = StableDiffusionXLPipeline.from_pretrained("fluently/Fluently-XL-Final", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False)
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_neo = 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_neo.load_lora_weights("ehristoforu/dalle-3-xl-v2", adapter_name="base")
52
- repo_neo.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")
57
  repo_pixel.set_adapters(["base", "base2"], adapter_weights=[1, 1])
58
 
 
 
 
 
59
  repo_customs = {
60
  "Default": repo_default,
61
- "Neo": repo_neo,
62
  "Realistic": StableDiffusionXLPipeline.from_pretrained("ehristoforu/Visionix-alpha", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
63
  "Anime": StableDiffusionXLPipeline.from_pretrained("cagliostrolab/animagine-xl-3.1", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
64
  "Pixel": repo_pixel,
 
65
  }
66
 
67
  # Functions
@@ -92,15 +93,15 @@ def generate(input=DEFAULT_INPUT, filter_input="", negative_input=DEFAULT_NEGATI
92
  if model == "Realistic":
93
  steps_set = 25
94
  guidance_set = 7
95
- if model == "Neo":
96
- steps_set = 4
97
- guidance_set = 0
98
  elif model == "Anime":
99
  steps_set = 25
100
  guidance_set = 7
101
  elif model == "Pixel":
102
  steps_set = 15
103
  guidance_set = 1.5
 
 
 
104
  else:
105
  steps_set = 25
106
  guidance_set = 7
 
42
  '''
43
 
44
  repo_nsfw_classifier = pipeline("image-classification", model="Falconsai/nsfw_image_detection")
45
+ repo_base = StableDiffusionXLPipeline.from_pretrained("fluently/Fluently-XL-Final", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False)
46
 
47
+ repo_default = repo_base
48
  repo_default.load_lora_weights("ehristoforu/dalle-3-xl-v2", adapter_name="base")
49
  repo_default.set_adapters(["base"], adapter_weights=[0.7])
50
 
51
+ repo_pixel = repo_base
 
 
 
 
52
  repo_pixel.load_lora_weights("artificialguybr/PixelArtRedmond", adapter_name="base")
53
  repo_pixel.load_lora_weights("nerijs/pixel-art-xl", adapter_name="base2")
54
  repo_pixel.set_adapters(["base", "base2"], adapter_weights=[1, 1])
55
 
56
+ repo_neo = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16, use_safetensors=True, add_watermarker=False, revision="refs/pr/1")
57
+ repo_neo.load_lora_weights("ehristoforu/dalle-3-xl-v2", adapter_name="base")
58
+ repo_neo.set_adapters(["base"], adapter_weights=[0.7])
59
+
60
  repo_customs = {
61
  "Default": repo_default,
 
62
  "Realistic": StableDiffusionXLPipeline.from_pretrained("ehristoforu/Visionix-alpha", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
63
  "Anime": StableDiffusionXLPipeline.from_pretrained("cagliostrolab/animagine-xl-3.1", torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
64
  "Pixel": repo_pixel,
65
+ "Neo": repo_neo,
66
  }
67
 
68
  # Functions
 
93
  if model == "Realistic":
94
  steps_set = 25
95
  guidance_set = 7
 
 
 
96
  elif model == "Anime":
97
  steps_set = 25
98
  guidance_set = 7
99
  elif model == "Pixel":
100
  steps_set = 15
101
  guidance_set = 1.5
102
+ elif model == "Neo":
103
+ steps_set = 4
104
+ guidance_set = 0
105
  else:
106
  steps_set = 25
107
  guidance_set = 7