Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -116,7 +116,7 @@ def load_and_prepare_model(model_id):
|
|
| 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",use_safetensors=True)
|
| 120 |
|
| 121 |
#pipeX = StableDiffusionXLPipeline.from_pretrained("ford442/Juggernaut-XI-v11-fp32",use_safetensors=True)
|
| 122 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
|
@@ -131,19 +131,18 @@ def load_and_prepare_model(model_id):
|
|
| 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),
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
scheduler = sched
|
| 137 |
# scheduler = EulerAncestralDiscreteScheduler.from_config(pipeX.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
| 138 |
#scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset =1)
|
| 139 |
)
|
| 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 |
-
|
| 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
|
|
@@ -154,7 +153,14 @@ def load_and_prepare_model(model_id):
|
|
| 154 |
pipe.to(torch.bfloat16)
|
| 155 |
|
| 156 |
#pipe.to(torch.bfloat16)
|
| 157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
#pipe.to(torch.device("cuda:0"))
|
| 159 |
#pipe.vae.to(torch.bfloat16)
|
| 160 |
#pipe.to(device, torch.bfloat16)
|
|
|
|
| 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",use_safetensors=True)
|
| 120 |
|
| 121 |
#pipeX = StableDiffusionXLPipeline.from_pretrained("ford442/Juggernaut-XI-v11-fp32",use_safetensors=True)
|
| 122 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
|
|
|
| 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),
|
| 134 |
+
vae=vae,
|
| 135 |
+
unet=pipeX.unet,
|
| 136 |
+
scheduler = sched,
|
| 137 |
# scheduler = EulerAncestralDiscreteScheduler.from_config(pipeX.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
| 138 |
#scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset =1)
|
| 139 |
)
|
| 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 |
+
|
|
|
|
| 144 |
#pipe.scheduler = sched
|
| 145 |
+
#pipe.unet=pipeX.unet
|
| 146 |
# pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 147 |
#pipe.to(dtype=torch.bfloat16)
|
| 148 |
#pipe.unet = pipeX.unet
|
|
|
|
| 153 |
pipe.to(torch.bfloat16)
|
| 154 |
|
| 155 |
#pipe.to(torch.bfloat16)
|
| 156 |
+
print(f'Pipeline: ')
|
| 157 |
+
print(f'_optional_components: {pipe._optional_components} ')
|
| 158 |
+
print(f'watermark: {pipe.watermark} ')
|
| 159 |
+
print(f'safety_checker: {pipe.safety_checker)
|
| 160 |
+
print(f'final_image_processor: {pipe.final_image_processor}')
|
| 161 |
+
print(f'feature_extractor: {pipe.feature_extractor}')
|
| 162 |
+
pipe.watermark=None
|
| 163 |
+
pipe.safety_checker=None
|
| 164 |
#pipe.to(torch.device("cuda:0"))
|
| 165 |
#pipe.vae.to(torch.bfloat16)
|
| 166 |
#pipe.to(device, torch.bfloat16)
|