A lightweight LAMA model inference wrapper
Project description
Lite Lama - A lightweight LAMA inference wrapper
from litelama import LiteLama
import requests
from PIL import Image
from io import BytesIO
def download_image(url):
response = requests.get(url)
return Image.open(BytesIO(response.content)).convert("RGB")
img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"
mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"
lama = LiteLama()
lama.to("cuda:0")
init_image = download_image(img_url).resize((512, 512))
mask_image = download_image(mask_url).resize((512, 512))
lama.predict(init_image, mask_image).save("result.png")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
litelama-0.1.7.tar.gz
(1.4 MB
view hashes)
Built Distribution
litelama-0.1.7-py3-none-any.whl
(21.9 kB
view hashes)