ford442 commited on
Commit
610a218
·
verified ·
1 Parent(s): 7bb91da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -114,8 +114,8 @@ def load_and_prepare_model():
114
  #sched = EulerAncestralDiscreteScheduler.from_pretrained("SG161222/RealVisXL_V5.0", subfolder='scheduler',beta_schedule="scaled_linear", steps_offset=1,timestep_spacing="trailing"))
115
  #sched = EulerAncestralDiscreteScheduler.from_pretrained("SG161222/RealVisXL_V5.0", subfolder='scheduler', steps_offset=1,timestep_spacing="trailing")
116
  #sched = EulerAncestralDiscreteScheduler.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='scheduler',beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1,use_karras_sigmas=True)
117
- #sched = EulerAncestralDiscreteScheduler.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='scheduler',beta_schedule="scaled_linear")
118
- sched = DPMSolverSDEScheduler.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='scheduler')
119
  #pipeX = StableDiffusionXLPipeline.from_pretrained("SG161222/RealVisXL_V5.0").to(torch.bfloat16)
120
  #pipeX = StableDiffusionXLPipeline.from_pretrained("ford442/Juggernaut-XI-v11-fp32",use_safetensors=True)
121
  pipe = StableDiffusionXLPipeline.from_pretrained(
@@ -179,12 +179,8 @@ def load_and_prepare_model():
179
  #pipe.unet=pipeX.unet
180
  #pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
181
  #pipe.scheduler=EulerAncestralDiscreteScheduler.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='scheduler',beta_schedule="scaled_linear")
182
-
183
- pipe.vae.set_default_attn_processor()
184
- pipe.to(device)
185
- pipe.to(torch.bfloat16)
186
  # pipe.load_lora_weights("ford442/sdxl-vae-bf16", weight_name="LoRA/Fantasy_World_XL.safetensors", adapter_name="fantasy")
187
- pipe.load_lora_weights("ford442/sdxl-vae-bf16", weight_name="LoRA/skin_texture_style_v4.safetensors", adapter_name="skin")
188
  #pipe.unet.load_lora_adapter("ford442/sdxl-vae-bf16", weight_name="LoRA/skin_texture_style_v4.safetensors", prefix="unet")
189
  #pipe.text_encoder.load_lora_adapter("ford442/sdxl-vae-bf16", weight_name="LoRA/skin_texture_style_v4.safetensors", prefix="text_encoder")
190
 
@@ -192,6 +188,10 @@ def load_and_prepare_model():
192
  #pipe.set_adapters(["skin", "photo", "fantasy"], adapter_weights=[0.75, 0.25, 0.5])
193
  pipe.set_adapters(["skin"], adapter_weights=[0.5]) #pipe.unet.set_default_attn_processor()
194
 
 
 
 
 
195
  print(f'Pipeline: ')
196
  #print(f'_optional_components: {pipe._optional_components}')
197
  #print(f'watermark: {pipe.watermark}')
 
114
  #sched = EulerAncestralDiscreteScheduler.from_pretrained("SG161222/RealVisXL_V5.0", subfolder='scheduler',beta_schedule="scaled_linear", steps_offset=1,timestep_spacing="trailing"))
115
  #sched = EulerAncestralDiscreteScheduler.from_pretrained("SG161222/RealVisXL_V5.0", subfolder='scheduler', steps_offset=1,timestep_spacing="trailing")
116
  #sched = EulerAncestralDiscreteScheduler.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='scheduler',beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1,use_karras_sigmas=True)
117
+ sched = EulerAncestralDiscreteScheduler.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='scheduler',beta_schedule="scaled_linear")
118
+ #sched = DPMSolverSDEScheduler.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='scheduler')
119
  #pipeX = StableDiffusionXLPipeline.from_pretrained("SG161222/RealVisXL_V5.0").to(torch.bfloat16)
120
  #pipeX = StableDiffusionXLPipeline.from_pretrained("ford442/Juggernaut-XI-v11-fp32",use_safetensors=True)
121
  pipe = StableDiffusionXLPipeline.from_pretrained(
 
179
  #pipe.unet=pipeX.unet
180
  #pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
181
  #pipe.scheduler=EulerAncestralDiscreteScheduler.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='scheduler',beta_schedule="scaled_linear")
 
 
 
 
182
  # pipe.load_lora_weights("ford442/sdxl-vae-bf16", weight_name="LoRA/Fantasy_World_XL.safetensors", adapter_name="fantasy")
183
+ pipe.load_lora_weights("ford442/sdxl-vae-bf16", weight_name="LoRA/skin_texture_style_v4.safetensors", adapter_name="skin", low_cpu_mem_usage=False)
184
  #pipe.unet.load_lora_adapter("ford442/sdxl-vae-bf16", weight_name="LoRA/skin_texture_style_v4.safetensors", prefix="unet")
185
  #pipe.text_encoder.load_lora_adapter("ford442/sdxl-vae-bf16", weight_name="LoRA/skin_texture_style_v4.safetensors", prefix="text_encoder")
186
 
 
188
  #pipe.set_adapters(["skin", "photo", "fantasy"], adapter_weights=[0.75, 0.25, 0.5])
189
  pipe.set_adapters(["skin"], adapter_weights=[0.5]) #pipe.unet.set_default_attn_processor()
190
 
191
+ pipe.vae.set_default_attn_processor()
192
+ pipe.to(device)
193
+ pipe.to(torch.bfloat16)
194
+
195
  print(f'Pipeline: ')
196
  #print(f'_optional_components: {pipe._optional_components}')
197
  #print(f'watermark: {pipe.watermark}')