Computerender
Project description
Computerender Python Client
Installation
$ pip install computerender
Examples
from computerender import Computerender
import asyncio
cr = Computerender()
# Generate image and save to file
with open("cow.jpg", "wb") as f:
img_bytes = asyncio.run(cr.generate("a cow wearing sunglasses"))
f.write(img_bytes)
# Generate image with custom parameters
img_bytes = asyncio.run(cr.generate("testing", w=1024, h=384, iterations=20))
# img2img generation reading from and writing to files
with open("cow.jpg", "rb") as in_f:
img_bytes = asyncio.run(
cr.generate(
"van gogh painting of a cow wearing sunglasses",
img=in_f.read()
)
)
with open("van_gogh_cow.jpg", "wb") as out_f:
out_f.write(img_bytes)
# img2img one-liner reading and writing to file
open("fly.jpg", "wb").write(asyncio.run(cr.generate("fly", img=open("cow.jpg", "rb").read())))
# Generate image and use it for img2img without saving anything to files
img_bytes = asyncio.run(
cr.generate("testing", w=1024, h=384, iterations=20)
)
result_bytes = asyncio.run(
cr.generate("testing style transfer", img=img_bytes)
)
"a cow wearing sunglasses"
"van gogh painting of a cow wearing sunglasses"
License
Distributed under the terms of the [MIT license][license]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
computerender-0.1.2.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for computerender-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f47b608db1ae8d7d1380471f0a235d7e7af1a4e1e50dbd66af3b9a398f5e452f |
|
MD5 | f069a27f47c8b3456fd113b6d381e5a7 |
|
BLAKE2b-256 | aebf42197a2fe938cb3776cf58f7ba887f6fa4970d7ea5c70560a14d95528c2c |