Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -112,20 +112,22 @@ def load_and_prepare_model(model_id):
|
|
112 |
# vae = AutoencoderKL.from_pretrained("BeastHF/MyBack_SDXL_Juggernaut_XL_VAE/MyBack_SDXL_Juggernaut_XL_VAE_V10(version_X).safetensors",safety_checker=None).to(torch.bfloat16)
|
113 |
# vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", safety_checker=None).to('cuda')
|
114 |
#sched = EulerAncestralDiscreteScheduler.from_config('ford442/Juggernaut-XI-v11-fp32', subfolder='scheduler',beta_schedule="scaled_linear",use_karras_sigmas=True)
|
115 |
-
sched = EulerAncestralDiscreteScheduler.from_pretrained("SG161222/RealVisXL_V5.0", subfolder='scheduler',beta_schedule="scaled_linear")
|
|
|
116 |
#sched = EulerAncestralDiscreteScheduler.from_config('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_config('ford442/RealVisXL_V5.0_BF16', beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
118 |
-
pipeX = StableDiffusionXLPipeline.from_pretrained("SG161222/RealVisXL_V5.0")
|
119 |
|
120 |
#pipeX = StableDiffusionXLPipeline.from_pretrained("ford442/Juggernaut-XI-v11-fp32",torch_dtype=torch.float32)
|
121 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
122 |
'ford442/RealVisXL_V5.0_BF16',
|
123 |
# 'ford442/Juggernaut-XI-v11-fp32',
|
|
|
124 |
#torch_dtype=torch.bfloat16,
|
125 |
add_watermarker=False,
|
126 |
# custom_pipeline="lpw_stable_diffusion_xl",
|
127 |
#use_safetensors=True,
|
128 |
-
|
129 |
# vae=AutoencoderKL.from_pretrained("BeastHF/MyBack_SDXL_Juggernaut_XL_VAE/MyBack_SDXL_Juggernaut_XL_VAE_V10(version_X).safetensors",repo_type='model',safety_checker=None),
|
130 |
# vae=AutoencoderKL.from_pretrained("stabilityai/sdxl-vae",repo_type='model',safety_checker=None, torch_dtype=torch.float32),
|
131 |
# vae=AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16",repo_type='model',safety_checker=None),
|
@@ -138,8 +140,10 @@ def load_and_prepare_model(model_id):
|
|
138 |
#sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear",use_karras_sigmas=True, algorithm_type="dpmsolver++")
|
139 |
#pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
140 |
#pipe.to('cuda')
|
|
|
|
|
141 |
#pipe.scheduler = sched
|
142 |
-
pipe.unet=pipeX.unet
|
143 |
# pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
144 |
#pipe.to(dtype=torch.bfloat16)
|
145 |
#pipe.unet = pipeX.unet
|
@@ -147,7 +151,7 @@ def load_and_prepare_model(model_id):
|
|
147 |
#pipe.unet.to(torch.bfloat16)
|
148 |
|
149 |
pipe.to(device)
|
150 |
-
pipe.
|
151 |
|
152 |
#pipe.to(torch.bfloat16)
|
153 |
|
|
|
112 |
# vae = AutoencoderKL.from_pretrained("BeastHF/MyBack_SDXL_Juggernaut_XL_VAE/MyBack_SDXL_Juggernaut_XL_VAE_V10(version_X).safetensors",safety_checker=None).to(torch.bfloat16)
|
113 |
# vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", safety_checker=None).to('cuda')
|
114 |
#sched = EulerAncestralDiscreteScheduler.from_config('ford442/Juggernaut-XI-v11-fp32', subfolder='scheduler',beta_schedule="scaled_linear",use_karras_sigmas=True)
|
115 |
+
sched = EulerAncestralDiscreteScheduler.from_pretrained("SG161222/RealVisXL_V5.0", subfolder='scheduler',beta_schedule="scaled_linear", steps_offset=1)
|
116 |
+
#sched = EulerAncestralDiscreteScheduler()
|
117 |
#sched = EulerAncestralDiscreteScheduler.from_config('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)
|
118 |
# sched = EulerAncestralDiscreteScheduler.from_config('ford442/RealVisXL_V5.0_BF16', beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
119 |
+
pipeX = StableDiffusionXLPipeline.from_pretrained("SG161222/RealVisXL_V5.0").to(torch.bfloat16)
|
120 |
|
121 |
#pipeX = StableDiffusionXLPipeline.from_pretrained("ford442/Juggernaut-XI-v11-fp32",torch_dtype=torch.float32)
|
122 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
123 |
'ford442/RealVisXL_V5.0_BF16',
|
124 |
# 'ford442/Juggernaut-XI-v11-fp32',
|
125 |
+
#'SG161222/RealVisXL_V5.0',
|
126 |
#torch_dtype=torch.bfloat16,
|
127 |
add_watermarker=False,
|
128 |
# custom_pipeline="lpw_stable_diffusion_xl",
|
129 |
#use_safetensors=True,
|
130 |
+
# use_auth_token=HF_TOKEN,
|
131 |
# vae=AutoencoderKL.from_pretrained("BeastHF/MyBack_SDXL_Juggernaut_XL_VAE/MyBack_SDXL_Juggernaut_XL_VAE_V10(version_X).safetensors",repo_type='model',safety_checker=None),
|
132 |
# vae=AutoencoderKL.from_pretrained("stabilityai/sdxl-vae",repo_type='model',safety_checker=None, torch_dtype=torch.float32),
|
133 |
# vae=AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16",repo_type='model',safety_checker=None),
|
|
|
140 |
#sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear",use_karras_sigmas=True, algorithm_type="dpmsolver++")
|
141 |
#pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
142 |
#pipe.to('cuda')
|
143 |
+
pipe.watermark=None
|
144 |
+
pipe.safety_checker=None
|
145 |
#pipe.scheduler = sched
|
146 |
+
pipe.unet=pipeX.unet
|
147 |
# pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
148 |
#pipe.to(dtype=torch.bfloat16)
|
149 |
#pipe.unet = pipeX.unet
|
|
|
151 |
#pipe.unet.to(torch.bfloat16)
|
152 |
|
153 |
pipe.to(device)
|
154 |
+
pipe.to(torch.bfloat16)
|
155 |
|
156 |
#pipe.to(torch.bfloat16)
|
157 |
|