Skip to main content

A client of IXSPY AI Image api

Project description

IXSPY Image API

IXSPY Image API V1.0 official python version

README.md

Installation

  1. pypi install
pip install ixspy-img-api
  1. Source code install
git clone https://github.com/ixspyinc/ixspy-img-api.git
cd ixspy-img-api-python
python setup.py install

Usage

Basic usage

import os
import sys
from ixspy_img_api import AIImageGenerator

# 分步骤调用, 任务方法和参数都已约定好

API_KEY = 'YOUR_KEY'
FOLDER_PATH = os.path.dirname(os.path.abspath(sys.argv[0])) + os.sep
original_image_path = FOLDER_PATH + 'images/speaker.jpg'

client = AIImageGenerator(api_key=API_KEY)

task_id = client.create_custom_composition(
    original_image=original_image_path,
    prompt="移除产品背景,只保留白色背景产品图",
)
print(f"任务ID: {task_id}")


# 轮询等待完成
result = client.wait_for_completion(task_id, poll_interval=3, timeout=180)

# 可和预生成的图片 examples/images/demo_result_create_custom_composition.png 对比
print("标清图URL:", result['sd_image_url'])

# 获取高清图
hd_url = client.get_hd_image(task_id)
print("高清图URL:", hd_url)

Advance use

For detailed usage, please refer to the files in the /examples directory.

API document

https://img.ixspy.com/api-doc.html

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

ixspy_img_api-1.0.5.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ixspy_img_api-1.0.5-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file ixspy_img_api-1.0.5.tar.gz.

File metadata

  • Download URL: ixspy_img_api-1.0.5.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ixspy_img_api-1.0.5.tar.gz
Algorithm Hash digest
SHA256 4203102428798b4bccacb965a347cd1def47a43ad2b242d3d7555efa2bbe79a4
MD5 581435112d2a3e22f8664ba6649fa7b6
BLAKE2b-256 c9ee13962c302f7763e4491404974144ba3b11d3893c3cf6c729a52df2c1903b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ixspy_img_api-1.0.5.tar.gz:

Publisher: python-publish.yml on ixspyinc/ixspy-img-api-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ixspy_img_api-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: ixspy_img_api-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ixspy_img_api-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0c93a58cad799946186e68e12e137384fa71bec2668cb19f38326f4c6317374c
MD5 e8266128e4b1effe90c65fad823f0885
BLAKE2b-256 4b62bd7a5decf7d0efd8d4decfd6097ebf1a8bb5d0e20049ca62dee70e4f7505

See more details on using hashes here.

Provenance

The following attestation bundles were made for ixspy_img_api-1.0.5-py3-none-any.whl:

Publisher: python-publish.yml on ixspyinc/ixspy-img-api-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page