Skip to main content

karlo-py

pip install karlo-py

Karlo는 카카오에서 만든 사용자가 입력한 문장과 이미지를 기반으로 새로운 이미지를 만드는 기능입니다.

생성형 인공지능(AI) Karlo는 1억 8천만 장 규모의 이미지-텍스트 학습을 통해 사용자가 묘사한 내용을 이해하고,

픽셀 단위로 완전히 새로운 이미지를 생성합니다.

또한 사용자가 원하는 콘셉트에 맞춰 창작 활동을 할 수 있도록 사물, 배경, 조명, 구도, 다양한 화풍을 지원합니다.

B^EDIT에서 Karlo를 사용한 이미지 생성 기능을 간편하게 체험해 볼 수 있습니다.

온라인 B^EDIT 체험하기

사용 방법

프롬프트

프롬프트(Prompt)는 Karlo API를 통해 이미지를 생성하는 데 필요한 입력 정보입니다.

프롬프트는 생성할 이미지를 묘사하는 제시어 또는 문장으로 구성되고, 기능별로 원본 이미지 등 추가 정보를 포함할 수 있습니다.

활용 가이드에서 프롬프트를 효과적으로 구성하는 방법과 다양한 예제를 확인할 수 있습니다.

지원 언어: 프롬프트의 제시어는 영문만 지원합니다. Karlo는 단순한 단어의 나열부터 장문의 묘사까지 구체적으로 이해할 수 있으므로, 영어가 유창하지 않아도 누구나 쉽게 사용해볼 수 있습니다.

이미지 생성하기

입력된 텍스트에 따라 이미지를 생성합니다.

생성할 이미지를 묘사하는 제시어를 구성해 전달하면, Karlo가 프롬프트의 제시어를 바탕으로 새로운 이미지를 생성합니다.

제시어로 계절과 같은 시기적 특징을 반영하도록 하거나, 특정 작가의 스타일을 사용하도록 지정할 수도 있습니다.

사용 예시

import asyncio
import os

from karlo_py import gen_image, gen_variation


async def main():
    API_KEY = os.getenv("API_KEY")

    if API_KEY is None:
        raise ValueError("API_KEY not set in environment")

    text = "A newyork home, steampunk, snowy"
    output_name = "py_img/output"  # will be png
    batch_size = 2  # or an integer between 1 and 8

    try:
        await gen_image(text, output_name, API_KEY, batch_size)
        print(f"Image saved to {output_name}")
    except Exception as e:
        print(e)

    input_path = "py_img/output_1.png"
    output_name = "py_img/output_variation"  # will be png
    batch_size = None  # or an integer between 1 and 8

    try:
        await gen_variation(input_path, output_name, API_KEY, batch_size)
        print(f"Variation image saved to {output_name}")
    except Exception as e:
        print(f"Error: {e}")


if __name__ == "__main__":
    asyncio.run(main())

위 실행 결과

Prompt: A newyork home, steampunk, snowy

output_1 output_2

Variation

output_variation_1

Metadata

Release files for karlo-py 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for karlo-py 1.0.1
File Size Uploaded Provenance Actions
karlo_py-1.0.1.tar.gz 7.0 MB Without provenance Details for karlo_py-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for karlo-py 1.0.1
File Interpreter ABI Platform Actions
karlo_py-1.0.1-cp311-none-win_amd64.whl CPython 3.11 none Windows x86-64 Details for karlo_py-1.0.1-cp311-none-win_amd64.whl

Total release size: 9.5 MB

Release files / karlo_py-1.0.1.tar.gz

Download URL karlo_py-1.0.1.tar.gz
Size 7.0 MB
Tags Source
SHA-256 checksum
How to use checksums
4746a6924ce9ed5ff8fe75a972dbf74931f8f37e90873c94a1209761d559a56b
BLAKE2b-256 checksum
How to use checksums
5b04b80f7f2fdca1679089b77e796ba7d33dc754ed1736355b94a3ddb6cdb04e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.15

Release files / karlo_py-1.0.1-cp311-none-win_amd64.whl

Download URL karlo_py-1.0.1-cp311-none-win_amd64.whl
Size 2.5 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
30b636fe021cd55875c18420d4bda8d1026b1e62b6426fcdcac97d16dfaaad9a
BLAKE2b-256 checksum
How to use checksums
41d4cc5dbaa8105ecad1a7150862dbb758433be50104784531c8136be631b5d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.15

Security for karlo-py 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page