Update app.py
Browse files
app.py
CHANGED
@@ -75,17 +75,17 @@ def pipe_inference(
|
|
75 |
if not isinstance(image, np.ndarray):
|
76 |
image = np.array(image)
|
77 |
|
78 |
-
|
79 |
|
80 |
if not is_canny:
|
81 |
-
resized_image = preprocess_canny(
|
82 |
|
83 |
rng = create_key(seed)
|
84 |
rng = jax.random.split(rng, jax.device_count())
|
85 |
|
86 |
prompt_ids = pipe.prepare_text_inputs([prompt] * num_samples)
|
87 |
negative_prompt_ids = pipe.prepare_text_inputs([negative_prompt] * num_samples)
|
88 |
-
processed_image = pipe.prepare_image_inputs([
|
89 |
|
90 |
p_params = replicate(params)
|
91 |
prompt_ids = shard(prompt_ids)
|
|
|
75 |
if not isinstance(image, np.ndarray):
|
76 |
image = np.array(image)
|
77 |
|
78 |
+
processed_image = resize_image(image, resolution)
|
79 |
|
80 |
if not is_canny:
|
81 |
+
resized_image, processed_image = preprocess_canny(processed_image, resolution)
|
82 |
|
83 |
rng = create_key(seed)
|
84 |
rng = jax.random.split(rng, jax.device_count())
|
85 |
|
86 |
prompt_ids = pipe.prepare_text_inputs([prompt] * num_samples)
|
87 |
negative_prompt_ids = pipe.prepare_text_inputs([negative_prompt] * num_samples)
|
88 |
+
processed_image = pipe.prepare_image_inputs([processed_image] * num_samples)
|
89 |
|
90 |
p_params = replicate(params)
|
91 |
prompt_ids = shard(prompt_ids)
|