You can install the Novita Python SDK using just one command
pip install novita-client
get NOVITA_API_KEY
from https://novita.ai/get-started/
Finally, you can try the change cat to dog by following this code.
import os
from novita_client import NovitaClient, Txt2ImgRequest, UpscaleRequest
from novita_client.utils import base64_to_image, image_to_base64
from PIL import Image
from io import BytesIO
novita = NovitaClient(os.getenv('NOVITA_API_KEY'))
replace_object_res = novita.replace_object(image="https://cdn-images-1.medium.com/max/1600/1*E3jkiGoC8EfVlqqhE_6SWw.png", object_prompt="a cat", prompt="a dog", response_image_type="png")
replace_object_generated = base64_to_image(replace_object_res.image_file)
replace_object_generated.save("replace-object.png")
novita-client is the Python SDK of Novita.AI, which provides the following features.
- cleanup - remove all your generated images
- remove-background - remove background from image
- remove-text - remove text from image
- reimagine - reimagine image
- doodle - doodle image
- merge-face - merge face
- mix-pose - mix pose
- outpainting - outpainting
- replace-object - remove object
- replace-background - replace background
- replace-sky - replace sky
- create-tile - create tile
Top comments (0)