Spaces:
Runtime error
Runtime error
shard conditioning image input
Browse files
app.py
CHANGED
@@ -54,6 +54,7 @@ def infer(prompt, negative_prompt, image):
|
|
54 |
cond_input = T.ToPILImage()(cond_input)
|
55 |
|
56 |
cond_img_in = pipe.prepare_image_inputs([cond_input] * num_samples)
|
|
|
57 |
|
58 |
prompt_in = pipe.prepare_text_inputs([prompt] * num_samples)
|
59 |
prompt_in = shard(prompt_in)
|
@@ -69,11 +70,11 @@ def infer(prompt, negative_prompt, image):
|
|
69 |
output = pipe(
|
70 |
prompt_ids=prompt_in,
|
71 |
image=cond_img_in,
|
|
|
72 |
prng_seed=rng,
|
|
|
73 |
neg_prompt_ids=n_prompt_in,
|
74 |
-
|
75 |
-
num_inference_steps=20,
|
76 |
-
jit=True
|
77 |
).images
|
78 |
|
79 |
output_images = pipe.numpy_to_pil(np.asarray(output.reshape((num_samples,) + output.shape[-3:])))
|
|
|
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)
|
58 |
|
59 |
prompt_in = pipe.prepare_text_inputs([prompt] * num_samples)
|
60 |
prompt_in = shard(prompt_in)
|
|
|
70 |
output = pipe(
|
71 |
prompt_ids=prompt_in,
|
72 |
image=cond_img_in,
|
73 |
+
params=p_params,
|
74 |
prng_seed=rng,
|
75 |
+
num_inference_steps=50,
|
76 |
neg_prompt_ids=n_prompt_in,
|
77 |
+
jit=True,
|
|
|
|
|
78 |
).images
|
79 |
|
80 |
output_images = pipe.numpy_to_pil(np.asarray(output.reshape((num_samples,) + output.shape[-3:])))
|