Skip to content

Commit

Permalink
cast image down to 16 bit from 32
Browse files Browse the repository at this point in the history
  • Loading branch information
JEMeyer committed May 16, 2024
1 parent 492c062 commit 0e0bfca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stablediffusion_fastapi_multigpu/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ async def img2img(prompt: str = Form(...), image: UploadFile = File(...)):
# Ensure to use the selected GPU for computations
pipe = img2img_pipes[gpu_id]

init_image = Image.open(BytesIO(await image.read()))
init_image = Image.open(BytesIO(await image.read())).to(
dtype=torch.float16
)

image = pipe(
prompt=prompt,
Expand Down

0 comments on commit 0e0bfca

Please sign in to comment.