Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -110,10 +110,10 @@ def load_and_prepare_model(model_id):
|
|
110 |
# vae = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae", torch_dtype=torch.float32,safety_checker=None)
|
111 |
# 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)
|
112 |
# vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", safety_checker=None).to('cuda')
|
113 |
-
pipeX = StableDiffusionXLPipeline.from_pretrained("SG161222/RealVisXL_V5.0")
|
114 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
115 |
model_id,
|
116 |
-
|
117 |
add_watermarker=False,
|
118 |
use_safetensors=True,
|
119 |
# 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),
|
@@ -124,10 +124,10 @@ def load_and_prepare_model(model_id):
|
|
124 |
#pipe.to('cuda')
|
125 |
# pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
126 |
|
127 |
-
pipe.unet = pipeX.unet
|
128 |
#pipe.to(dtype=torch.bfloat16)
|
129 |
pipe.to(device)
|
130 |
-
pipe.to(torch.bfloat16)
|
131 |
#pipe.to(device, torch.bfloat16)
|
132 |
del pipeX
|
133 |
#sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", algorithm_type="dpmsolver++")
|
@@ -210,7 +210,7 @@ def generate_30(
|
|
210 |
f.write(f"Guidance Scale: {guidance_scale} \n")
|
211 |
f.write(f"SPACE SETUP: \n")
|
212 |
f.write(f"Use Safetensors: True \n")
|
213 |
-
f.write(f"Use Model Dtype: yes \n")
|
214 |
f.write(f"Model Scheduler: Euler_a custom \n")
|
215 |
f.write(f"Model VAE: stabilityai/sdxl-vae no dtype \n")
|
216 |
f.write(f"Model UNET: stabilityai no dtype \n")
|
@@ -276,7 +276,7 @@ def generate_60(
|
|
276 |
f.write(f"Guidance Scale: {guidance_scale} \n")
|
277 |
f.write(f"SPACE SETUP: \n")
|
278 |
f.write(f"Use Safetensors: True \n")
|
279 |
-
f.write(f"Use Model Dtype: yes \n")
|
280 |
f.write(f"Model Scheduler: Euler_a custom \n")
|
281 |
f.write(f"Model VAE: stabilityai/sdxl-vae no dtype \n")
|
282 |
f.write(f"Model UNET: stabilityai no dtype \n")
|
@@ -342,7 +342,7 @@ def generate_90(
|
|
342 |
f.write(f"Guidance Scale: {guidance_scale} \n")
|
343 |
f.write(f"SPACE SETUP: \n")
|
344 |
f.write(f"Use Safetensors: True \n")
|
345 |
-
f.write(f"Use Model Dtype: yes \n")
|
346 |
f.write(f"Model Scheduler: Euler_a custom \n")
|
347 |
f.write(f"Model VAE: stabilityai/sdxl-vae no dtype \n")
|
348 |
f.write(f"Model UNET: stabilityai no dtype \n")
|
|
|
110 |
# vae = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae", torch_dtype=torch.float32,safety_checker=None)
|
111 |
# 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)
|
112 |
# vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", safety_checker=None).to('cuda')
|
113 |
+
pipeX = StableDiffusionXLPipeline.from_pretrained("SG161222/RealVisXL_V5.0",torch_dtype=torch.float32)
|
114 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
115 |
model_id,
|
116 |
+
torch_dtype=torch.bfloat16,
|
117 |
add_watermarker=False,
|
118 |
use_safetensors=True,
|
119 |
# 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),
|
|
|
124 |
#pipe.to('cuda')
|
125 |
# pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
126 |
|
127 |
+
pipe.unet = pipeX.unet.to(torch.bfloat16)
|
128 |
#pipe.to(dtype=torch.bfloat16)
|
129 |
pipe.to(device)
|
130 |
+
#pipe.to(torch.bfloat16)
|
131 |
#pipe.to(device, torch.bfloat16)
|
132 |
del pipeX
|
133 |
#sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", algorithm_type="dpmsolver++")
|
|
|
210 |
f.write(f"Guidance Scale: {guidance_scale} \n")
|
211 |
f.write(f"SPACE SETUP: \n")
|
212 |
f.write(f"Use Safetensors: True \n")
|
213 |
+
f.write(f"Use Model Dtype: yes with UNET to bfloat \n")
|
214 |
f.write(f"Model Scheduler: Euler_a custom \n")
|
215 |
f.write(f"Model VAE: stabilityai/sdxl-vae no dtype \n")
|
216 |
f.write(f"Model UNET: stabilityai no dtype \n")
|
|
|
276 |
f.write(f"Guidance Scale: {guidance_scale} \n")
|
277 |
f.write(f"SPACE SETUP: \n")
|
278 |
f.write(f"Use Safetensors: True \n")
|
279 |
+
f.write(f"Use Model Dtype: yes with UNET to bfloat \n")
|
280 |
f.write(f"Model Scheduler: Euler_a custom \n")
|
281 |
f.write(f"Model VAE: stabilityai/sdxl-vae no dtype \n")
|
282 |
f.write(f"Model UNET: stabilityai no dtype \n")
|
|
|
342 |
f.write(f"Guidance Scale: {guidance_scale} \n")
|
343 |
f.write(f"SPACE SETUP: \n")
|
344 |
f.write(f"Use Safetensors: True \n")
|
345 |
+
f.write(f"Use Model Dtype: yes with UNET to bfloat \n")
|
346 |
f.write(f"Model Scheduler: Euler_a custom \n")
|
347 |
f.write(f"Model VAE: stabilityai/sdxl-vae no dtype \n")
|
348 |
f.write(f"Model UNET: stabilityai no dtype \n")
|