Spaces:
Runtime error
Runtime error
add cpu offload and index augmented conditioning input
Browse files
app.py
CHANGED
|
@@ -26,6 +26,8 @@ pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
|
| 26 |
torch_dtype=torch.float32,
|
| 27 |
)
|
| 28 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
|
|
|
|
|
|
| 29 |
|
| 30 |
generator = torch.manual_seed(0)
|
| 31 |
|
|
@@ -38,7 +40,7 @@ def infer(prompt, negative_prompt, image):
|
|
| 38 |
|
| 39 |
output = pipe(
|
| 40 |
prompt,
|
| 41 |
-
cond_input,
|
| 42 |
generator=generator,
|
| 43 |
num_images_per_prompt=4,
|
| 44 |
num_inference_steps=20
|
|
|
|
| 26 |
torch_dtype=torch.float32,
|
| 27 |
)
|
| 28 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
| 29 |
+
pipe.enable_model_cpu_offload()
|
| 30 |
+
#pipe.enable_xformers_memory_efficient_attention()
|
| 31 |
|
| 32 |
generator = torch.manual_seed(0)
|
| 33 |
|
|
|
|
| 40 |
|
| 41 |
output = pipe(
|
| 42 |
prompt,
|
| 43 |
+
cond_input[0],
|
| 44 |
generator=generator,
|
| 45 |
num_images_per_prompt=4,
|
| 46 |
num_inference_steps=20
|