Update app.py
Browse files
app.py
CHANGED
@@ -9,10 +9,10 @@ import traceback
|
|
9 |
# ========== 1. Load Models ==========
|
10 |
pipe = StableDiffusionXLControlNetRAWPipeline.from_pretrained(
|
11 |
"wencheng256/DiffusionRAW",
|
12 |
-
torch_dtype=torch.
|
13 |
)
|
14 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
15 |
-
|
16 |
|
17 |
# ========== 2. Utility function: tensor -> PIL ==========
|
18 |
def tensor_to_pil(img_tensor: torch.Tensor) -> Image.Image:
|
|
|
9 |
# ========== 1. Load Models ==========
|
10 |
pipe = StableDiffusionXLControlNetRAWPipeline.from_pretrained(
|
11 |
"wencheng256/DiffusionRAW",
|
12 |
+
torch_dtype=torch.float16
|
13 |
)
|
14 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
15 |
+
pipe.enable_model_cpu_offload()
|
16 |
|
17 |
# ========== 2. Utility function: tensor -> PIL ==========
|
18 |
def tensor_to_pil(img_tensor: torch.Tensor) -> Image.Image:
|