Metadata-Version: 2.4
Name: ixspy-img-api
Version: 0.0.0
Summary: A client of IXSPY AI Image api
Home-page: https://github.com/ixspyinc/ixspy-img-api-python
Author: IXSPY Team
Author-email: tech@ixspy.com
License: MIT
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

# IXSPY Image API

IXSPY Image API V1.0 official python version

## README.md

## Installation

1. pypi install
```BASH
pip install ixspy-img-api
```

2. Source code install
```BASH
git clone https://github.com/ixspyinc/ixspy-img-api.git
cd ixspy-img-api-python
python setup.py install
```

## Usage

Basic usage
```python
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
