Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -115,7 +115,7 @@ def load_and_prepare_model(model_id):
|
|
115 |
#pipeX = StableDiffusionXLPipeline.from_pretrained("ford442/Juggernaut-XI-v11-fp32",torch_dtype=torch.float32)
|
116 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
117 |
model_id,
|
118 |
-
torch_dtype=torch.bfloat16,
|
119 |
add_watermarker=False,
|
120 |
# use_safetensors=True,
|
121 |
# 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,12 +132,12 @@ def load_and_prepare_model(model_id):
|
|
132 |
#pipe.vae=pipeX.vae
|
133 |
# pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
134 |
#pipe.to(dtype=torch.bfloat16)
|
135 |
-
pipe.unet = pipeX.unet
|
136 |
pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
137 |
-
pipe.unet.to(torch.bfloat16)
|
138 |
pipe.to(device)
|
139 |
#pipe.vae.to(torch.bfloat16)
|
140 |
-
|
141 |
#pipe.to(device, torch.bfloat16)
|
142 |
del pipeX
|
143 |
#sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", algorithm_type="dpmsolver++")
|
@@ -222,11 +222,10 @@ def generate_30(
|
|
222 |
f.write(f"Steps: {num_inference_steps} \n")
|
223 |
f.write(f"Guidance Scale: {guidance_scale} \n")
|
224 |
f.write(f"SPACE SETUP: \n")
|
225 |
-
f.write(f"Use Safetensors: no \n")
|
226 |
f.write(f"Use Model Dtype: no \n")
|
227 |
f.write(f"Model Scheduler: Euler_a custom before cuda \n")
|
228 |
-
f.write(f"Model VAE:
|
229 |
-
f.write(f"Model UNET:
|
230 |
upload_to_ftp(filename)
|
231 |
for i in range(0, num_images, BATCH_SIZE):
|
232 |
batch_options = options.copy()
|
@@ -289,11 +288,10 @@ def generate_60(
|
|
289 |
f.write(f"Steps: {num_inference_steps} \n")
|
290 |
f.write(f"Guidance Scale: {guidance_scale} \n")
|
291 |
f.write(f"SPACE SETUP: \n")
|
292 |
-
f.write(f"Use Safetensors: no \n")
|
293 |
f.write(f"Use Model Dtype: no \n")
|
294 |
f.write(f"Model Scheduler: Euler_a custom before cuda \n")
|
295 |
-
f.write(f"Model VAE:
|
296 |
-
f.write(f"Model UNET:
|
297 |
upload_to_ftp(filename)
|
298 |
for i in range(0, num_images, BATCH_SIZE):
|
299 |
batch_options = options.copy()
|
@@ -356,11 +354,10 @@ def generate_90(
|
|
356 |
f.write(f"Steps: {num_inference_steps} \n")
|
357 |
f.write(f"Guidance Scale: {guidance_scale} \n")
|
358 |
f.write(f"SPACE SETUP: \n")
|
359 |
-
f.write(f"Use Safetensors: no \n")
|
360 |
f.write(f"Use Model Dtype: no \n")
|
361 |
f.write(f"Model Scheduler: Euler_a custom before cuda \n")
|
362 |
-
f.write(f"Model VAE:
|
363 |
-
f.write(f"Model UNET:
|
364 |
upload_to_ftp(filename)
|
365 |
for i in range(0, num_images, BATCH_SIZE):
|
366 |
batch_options = options.copy()
|
|
|
115 |
#pipeX = StableDiffusionXLPipeline.from_pretrained("ford442/Juggernaut-XI-v11-fp32",torch_dtype=torch.float32)
|
116 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
117 |
model_id,
|
118 |
+
#torch_dtype=torch.bfloat16,
|
119 |
add_watermarker=False,
|
120 |
# use_safetensors=True,
|
121 |
# 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 |
#pipe.vae=pipeX.vae
|
133 |
# pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
134 |
#pipe.to(dtype=torch.bfloat16)
|
135 |
+
#pipe.unet = pipeX.unet
|
136 |
pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
137 |
+
#pipe.unet.to(torch.bfloat16)
|
138 |
pipe.to(device)
|
139 |
#pipe.vae.to(torch.bfloat16)
|
140 |
+
pipe.to(torch.bfloat16)
|
141 |
#pipe.to(device, torch.bfloat16)
|
142 |
del pipeX
|
143 |
#sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", algorithm_type="dpmsolver++")
|
|
|
222 |
f.write(f"Steps: {num_inference_steps} \n")
|
223 |
f.write(f"Guidance Scale: {guidance_scale} \n")
|
224 |
f.write(f"SPACE SETUP: \n")
|
|
|
225 |
f.write(f"Use Model Dtype: no \n")
|
226 |
f.write(f"Model Scheduler: Euler_a custom before cuda \n")
|
227 |
+
f.write(f"Model VAE: default \n")
|
228 |
+
f.write(f"Model UNET: default \n")
|
229 |
upload_to_ftp(filename)
|
230 |
for i in range(0, num_images, BATCH_SIZE):
|
231 |
batch_options = options.copy()
|
|
|
288 |
f.write(f"Steps: {num_inference_steps} \n")
|
289 |
f.write(f"Guidance Scale: {guidance_scale} \n")
|
290 |
f.write(f"SPACE SETUP: \n")
|
|
|
291 |
f.write(f"Use Model Dtype: no \n")
|
292 |
f.write(f"Model Scheduler: Euler_a custom before cuda \n")
|
293 |
+
f.write(f"Model VAE: default \n")
|
294 |
+
f.write(f"Model UNET: default \n")
|
295 |
upload_to_ftp(filename)
|
296 |
for i in range(0, num_images, BATCH_SIZE):
|
297 |
batch_options = options.copy()
|
|
|
354 |
f.write(f"Steps: {num_inference_steps} \n")
|
355 |
f.write(f"Guidance Scale: {guidance_scale} \n")
|
356 |
f.write(f"SPACE SETUP: \n")
|
|
|
357 |
f.write(f"Use Model Dtype: no \n")
|
358 |
f.write(f"Model Scheduler: Euler_a custom before cuda \n")
|
359 |
+
f.write(f"Model VAE: default \n")
|
360 |
+
f.write(f"Model UNET: default \n")
|
361 |
upload_to_ftp(filename)
|
362 |
for i in range(0, num_images, BATCH_SIZE):
|
363 |
batch_options = options.copy()
|