Skip to content

Commit

Permalink
fix(api): correct order for img2img params
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Feb 6, 2023
1 parent 35445ff commit 6fcfe4f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions api/onnx_web/diffusion/load.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from logging import getLogger
from typing import Any, Tuple
from typing import Any, Optional, Tuple

import numpy as np
from diffusers import DiffusionPipeline
Expand All @@ -9,9 +9,15 @@

logger = getLogger(__name__)

last_pipeline_instance = None
last_pipeline_options = (None, None, None)
last_pipeline_scheduler = None
last_pipeline_instance: Any = None
last_pipeline_options: Tuple[
Optional[DiffusionPipeline],
Optional[str],
Optional[str],
Optional[str],
Optional[bool],
] = (None, None, None, None, None)
last_pipeline_scheduler: Any = None

latent_channels = 4
latent_factor = 8
Expand Down
2 changes: 1 addition & 1 deletion api/onnx_web/diffusion/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def run_img2img_pipeline(
else:
rng = np.random.RandomState(params.seed)
result = pipe(
source_image,
params.prompt,
source_image,
generator=rng,
guidance_scale=params.cfg,
negative_prompt=params.negative_prompt,
Expand Down

0 comments on commit 6fcfe4f

Please sign in to comment.