Staticaliza commited on
Commit
7e50ae5
·
verified ·
1 Parent(s): 1eea9d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -7,7 +7,7 @@ import uuid
7
  import os
8
  from transformers import pipeline
9
 
10
- from diffusers import StableDiffusionXLPipeline, ControlNetModel
11
  from diffusers.models import AutoencoderKL
12
  from PIL import Image
13
 
@@ -39,6 +39,7 @@ vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype
39
  controlnet = ControlNetModel.from_pretrained("MakiPan/controlnet-encoded-hands-130k", torch_dtype=torch.float16)
40
 
41
  repo_default = StableDiffusionXLPipeline.from_pretrained("fluently/Fluently-XL-Final", vae=vae, controlnet=controlnet, torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False)
 
42
  repo_default.load_lora_weights("ehristoforu/dalle-3-xl-v2", adapter_name="base")
43
  repo_default.set_adapters("base")
44
  # repo_default.set_adapters(["base"], adapter_weights=[0.7])
@@ -54,7 +55,11 @@ repo_customs = {
54
  "Anime": StableDiffusionXLPipeline.from_pretrained("cagliostrolab/animagine-xl-3.1", vae=vae, controlnet=controlnet, torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
55
  "Pixel": repo_pixel,
56
  }
 
 
 
57
 
 
58
  # Functions
59
  def save_image(img, seed):
60
  name = f"{seed}-{uuid.uuid4()}.png"
 
7
  import os
8
  from transformers import pipeline
9
 
10
+ from diffusers import StableDiffusionXLPipeline, ControlNetModel, EulerAncestralDiscreteScheduler
11
  from diffusers.models import AutoencoderKL
12
  from PIL import Image
13
 
 
39
  controlnet = ControlNetModel.from_pretrained("MakiPan/controlnet-encoded-hands-130k", torch_dtype=torch.float16)
40
 
41
  repo_default = StableDiffusionXLPipeline.from_pretrained("fluently/Fluently-XL-Final", vae=vae, controlnet=controlnet, torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False)
42
+
43
  repo_default.load_lora_weights("ehristoforu/dalle-3-xl-v2", adapter_name="base")
44
  repo_default.set_adapters("base")
45
  # repo_default.set_adapters(["base"], adapter_weights=[0.7])
 
55
  "Anime": StableDiffusionXLPipeline.from_pretrained("cagliostrolab/animagine-xl-3.1", vae=vae, controlnet=controlnet, torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
56
  "Pixel": repo_pixel,
57
  }
58
+ print(repo_default.scheduler)
59
+
60
+ repo_default.scheduler = EulerAncestralDiscreteScheduler.from_config(repo_default.scheduler.config)
61
 
62
+ print(EulerAncestralDiscreteScheduler.from_config(repo_default.scheduler.config))
63
  # Functions
64
  def save_image(img, seed):
65
  name = f"{seed}-{uuid.uuid4()}.png"