PyClipdrop
Copyright © 2024 Minura Punchihewa
PyClipdrop is a Python library for interacting with the Clipdrop API. Clipdrop is a service that allows you to perform a variety of tasks on images such removing the background, removing text, and more.
Installation
With pip
pip install pyclipdrop
Usage
The library will first need to be configured with a Clipdrop API key. You can get an API key by signing up for the Clipdrop API. Once you have an API key, you can either set it to the CLIPDROP_API_KEY environment variable or pass it to the constructor of the ClipdropClient class.
from pyclipdrop import ClipdropClient
client = ClipdropClient('your-api-key')
# OR, if you have the API key set as an environment variable
client = ClipdropClient()
This client can now be used to perform a variety of tasks.
Cleanup
client.cleanup(
image_file='path/to/input.png',
mask_file='path/to/mask.png',
output_file='path/to/output.png'
)
Image Upscaling
client.image_upscaling(
image_file='path/to/input.png',
target_width=1920,
target_height=1080,
output_file='path/to/output.png'
)
Portrait Depth Estimation
client.portrait_depth_estimation(
image_file='path/to/input.png',
output_file='path/to/output.jpg'
)
Portrait Surface Normals
client.portrait_surface_normals(
image_file='path/to/input.png',
output_file='path/to/output.jpg'
)
Reimagine
client.reimagine(
image_file='path/to/input.png',
output_file='path/to/output.jpg'
)
Remove Background
client.remove_background(
image_file='path/to/input.png',
output_file='path/to/output.png'
)
Remove Text
client.remove_text(
image_file='path/to/input.png',
output_file='path/to/output.png'
)
Replace Background
client.replace_background(
image_file='path/to/input.png',
prompt='a cozy marble kitchen with wine glasses',
output_file='path/to/output.png'
)
Sketch to Image
client.sketch_to_image(
image_file='path/to/input.png',
prompt='an owl on a branch, cinematic',
output_file='path/to/output.jpg'
)
Text Inpainting
client.text_inpainting(
image_file='path/to/input.png',
mask_file='path/to/mask.png',
prompt='A woman with a red scarf',
output_file='path/to/output.jpg'
)
Text to Image
client.text_to_image(
prompt='shot of vaporwave fashion dog in miami',
output_file='path/to/output.png'
)
Uncrop
client.uncrop(
image_file='path/to/input.png',
extend_left=120,
extend_right=-50,
output_file='path/to/output.jpg'
)
License
This code is licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.txt for details.
Release files for pyclipdrop 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyclipdrop-1.0.1.tar.gz | 19.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyclipdrop-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.9 kB
Release files / pyclipdrop-1.0.1.tar.gz
| Download URL | pyclipdrop-1.0.1.tar.gz |
|---|---|
| Size | 19.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dc7230355c3f6b25b9eda1adf3a8f2735106d7e6b3344c48e91d9f6b3601c6f4
|
|
BLAKE2b-256 checksum How to use checksums |
ee0a9816a67ef877cbc1b957c729130a3811c38a365f989dbc3af08cc18b564a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.4 Linux/6.5.0-35-generic
|
Release files / pyclipdrop-1.0.1-py3-none-any.whl
| Download URL | pyclipdrop-1.0.1-py3-none-any.whl |
|---|---|
| Size | 21.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6f4e1199baa54648d99aaddec468b3b51c819a6bae1cf8d72ab3bada24c2d0b
|
|
BLAKE2b-256 checksum How to use checksums |
d3825f0c661fc298a115b39d2c13e6c4fe757bfce27636063f5970caa3b15801
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.4 Linux/6.5.0-35-generic
|