Skip to content

Commit

Permalink
lint, fix numpy error in pix2pix
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Apr 13, 2023
1 parent 953e772 commit bd99239
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/onnx_web/chain/blend_controlnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def blend_controlnet(
params.model,
params.scheduler,
job.get_device(),
control=None, # TODO: needs to have a ControlNet
control=None, # TODO: needs to have a ControlNet
)

rng = np.random.RandomState(params.seed)
Expand Down
1 change: 0 additions & 1 deletion api/onnx_web/diffusers/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ def load_pipeline(
model,
provider=device.ort_provider(),
sess_options=device.sess_options(),
revision="onnx",
safety_checker=None,
torch_dtype=torch_dtype,
**components,
Expand Down
2 changes: 1 addition & 1 deletion api/onnx_web/diffusers/pipelines/pix2pix.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def __call__(
):
progress_bar.update()
if callback is not None and i % callback_steps == 0:
callback(i, t, latents.numpy())
callback(i, t, latents)

# 10. Post-processing
image = self.decode_latents(latents)
Expand Down
4 changes: 3 additions & 1 deletion api/onnx_web/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ def get_and_clamp_int(
return min(max(int(args.get(key, default_value)), min_value), max_value)


def get_from_list(args: Any, key: str, values: Sequence[Any], default_value: Optional[Any] = None) -> Optional[Any]:
def get_from_list(
args: Any, key: str, values: Sequence[Any], default_value: Optional[Any] = None
) -> Optional[Any]:
selected = args.get(key, default_value)
if selected in values:
return selected
Expand Down

0 comments on commit bd99239

Please sign in to comment.