Skip to content

Commit

Permalink
fix(api): convert latents to numpy before using
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Nov 24, 2023
1 parent 98f8abb commit 8d44103
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/onnx_web/diffusers/pipelines/panorama_xl.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import numpy as np
import PIL
import torch
from diffusers.image_processor import VaeImageProcessor
from diffusers.pipelines.stable_diffusion_xl import StableDiffusionXLPipelineOutput
from optimum.onnxruntime.modeling_diffusion import ORTStableDiffusionXLPipelineBase
from optimum.pipelines.diffusers.pipeline_stable_diffusion_xl_img2img import (
StableDiffusionXLImg2ImgPipelineMixin,
)
from optimum.pipelines.diffusers.pipeline_utils import rescale_noise_cfg
from diffusers.image_processor import VaeImageProcessor

from onnx_web.chain.tile import make_tile_mask

Expand Down Expand Up @@ -730,7 +730,7 @@ def img2img(

# 3. Preprocess image
processor = VaeImageProcessor()
image = processor.preprocess(image)
image = processor.preprocess(image).cpu().numpy()

# 4. Prepare timesteps
self.scheduler.set_timesteps(num_inference_steps)
Expand Down
7 changes: 6 additions & 1 deletion api/onnx_web/diffusers/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,12 @@ def run_inpaint_pipeline(
latents = get_latents_from_seed(params.seed, size, batch=params.batch)
progress = worker.get_progress_callback()
images = chain.run(
worker, server, params, StageResult(images=[source]), callback=progress, latents=latents
worker,
server,
params,
StageResult(images=[source]),
callback=progress,
latents=latents,
)

_pairs, loras, inversions, _rest = parse_prompt(params)
Expand Down

0 comments on commit 8d44103

Please sign in to comment.