Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -105,21 +105,20 @@ base_model_path: str = "stabilityai/stable-diffusion-xl-base-1.0"
|
|
105 |
refiner_model_path: str = "stabilityai/stable-diffusion-xl-refiner-1.0"
|
106 |
unet_path: str = "cosmicman/CosmicMan-SDXL"
|
107 |
SCHEDULER = schedule_map[schedule]
|
108 |
-
scheduler = SCHEDULER.from_pretrained(base_model_path, subfolder="scheduler"
|
109 |
-
# unet = UNet2DConditionModel.from_pretrained(unet_path
|
110 |
|
111 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
112 |
base_model_path,
|
113 |
# unet=unet,
|
114 |
scheduler=scheduler,
|
115 |
-
torch_dtype=torch.float16,
|
116 |
use_safetensors=True
|
117 |
).to("cuda")
|
118 |
pipe.watermark = NoWatermark()
|
119 |
refiner = StableDiffusionXLImg2ImgPipeline.from_pretrained(
|
120 |
base_model_path, # we found use base_model_path instead of refiner_model_path may get a better performance
|
121 |
scheduler=scheduler,
|
122 |
-
|
123 |
).to("cuda")
|
124 |
refiner.watermark = NoWatermark()
|
125 |
print("Finish Loading Model!")
|
|
|
105 |
refiner_model_path: str = "stabilityai/stable-diffusion-xl-refiner-1.0"
|
106 |
unet_path: str = "cosmicman/CosmicMan-SDXL"
|
107 |
SCHEDULER = schedule_map[schedule]
|
108 |
+
scheduler = SCHEDULER.from_pretrained(base_model_path, subfolder="scheduler")
|
109 |
+
# unet = UNet2DConditionModel.from_pretrained(unet_path)
|
110 |
|
111 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
112 |
base_model_path,
|
113 |
# unet=unet,
|
114 |
scheduler=scheduler,
|
|
|
115 |
use_safetensors=True
|
116 |
).to("cuda")
|
117 |
pipe.watermark = NoWatermark()
|
118 |
refiner = StableDiffusionXLImg2ImgPipeline.from_pretrained(
|
119 |
base_model_path, # we found use base_model_path instead of refiner_model_path may get a better performance
|
120 |
scheduler=scheduler,
|
121 |
+
use_safetensors=True
|
122 |
).to("cuda")
|
123 |
refiner.watermark = NoWatermark()
|
124 |
print("Finish Loading Model!")
|