Spaces:
Runtime error
Runtime error
app.py
CHANGED
|
@@ -33,8 +33,7 @@ pipe, params = FlaxStableDiffusionControlNetPipeline.from_pretrained(
|
|
| 33 |
"./models/wd-1-5-b2-flax",
|
| 34 |
controlnet=cnet,
|
| 35 |
revision="flax",
|
| 36 |
-
dtype=jnp.bfloat16
|
| 37 |
-
safety_checker=None,
|
| 38 |
)
|
| 39 |
#pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
| 40 |
#pipe.enable_model_cpu_offload()
|
|
@@ -52,7 +51,7 @@ def infer(prompt, negative_prompt, image):
|
|
| 52 |
inp = Image.fromarray(image)
|
| 53 |
|
| 54 |
cond_input = conditioning_image_transforms(inp)
|
| 55 |
-
|
| 56 |
|
| 57 |
cond_img_in = pipe.prepare_image_inputs([cond_input] * num_samples)
|
| 58 |
cond_img_in = shard(cond_img_in)
|
|
|
|
| 33 |
"./models/wd-1-5-b2-flax",
|
| 34 |
controlnet=cnet,
|
| 35 |
revision="flax",
|
| 36 |
+
dtype=jnp.bfloat16
|
|
|
|
| 37 |
)
|
| 38 |
#pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
| 39 |
#pipe.enable_model_cpu_offload()
|
|
|
|
| 51 |
inp = Image.fromarray(image)
|
| 52 |
|
| 53 |
cond_input = conditioning_image_transforms(inp)
|
| 54 |
+
cond_input = T.ToPILImage()(cond_input)
|
| 55 |
|
| 56 |
cond_img_in = pipe.prepare_image_inputs([cond_input] * num_samples)
|
| 57 |
cond_img_in = shard(cond_img_in)
|