Metadata-Version: 2.4
Name: hermes-stepfun-imagegen
Version: 0.1.0
Summary: StepFun image generation backend for Hermes Agent (step-image-edit-2, step-2x-large, step-1x-medium).
Author: lora-sys
License: MIT
Project-URL: Homepage, https://github.com/lora-sys/hermes-stepfun-imagegen
Project-URL: Repository, https://github.com/lora-sys/hermes-stepfun-imagegen
Project-URL: Issues, https://github.com/lora-sys/hermes-stepfun-imagegen/issues
Keywords: hermes,hermes-agent,stepfun,image-generation,ai
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Hermes StepFun ImageGen

StepFun image generation backend for [Hermes Agent](https://github.com/NousResearch/hermes-agent).

Supports StepFun's image models:

- `step-image-edit-2` — recommended, fast text-to-image + image editing (1-2s)
- `step-2x-large` — high-quality text-to-image / image-to-image
- `step-1x-medium` — balanced quality and speed

## Installation

### From PyPI (once published)

```bash
pip install hermes-stepfun-imagegen
```

### From source

```bash
git clone https://github.com/lora-sys/hermes-stepfun-imagegen.git
cd hermes-stepfun-imagegen
pip install -e .
```

### Manual install

Copy the plugin directory to your Hermes plugins folder:

```bash
cp -r src/hermes_stepfun_imagegen ~/.hermes/plugins/image_gen/stepfun
```

## Configuration

### 1. Set your StepFun API key

Add to `~/.hermes/.env`:

```bash
STEPFUN_API_KEY=your-stepfun-api-key
```

Or export it in your shell:

```bash
export STEPFUN_API_KEY=your-stepfun-api-key
```

### 2. Enable the plugin

Add to `~/.hermes/config.yaml`:

```yaml
plugins:
  enabled:
    - image_gen/stepfun

image_gen:
  provider: stepfun
  model: step-image-edit-2  # optional, defaults to step-image-edit-2
```

### 3. Restart Hermes

```bash
hermes gateway restart
```

Or restart the Hermes desktop app.

## Usage

Once configured, the Hermes model can call `image_generate` directly:

**Text-to-image:**
```
生成一张赛博朋克风格的龙
```

**Image editing:**
```
把这张图换成水墨画风格
```
(with an image URL or file)

**Image-to-image:**
```
把这张照片转成梵高风格
```

## Model Selection

Change the default model in `config.yaml`:

```yaml
image_gen:
  provider: stepfun
  model: step-2x-large  # or step-1x-medium
```

Available models:

| Model | Speed | Best for |
|-------|-------|----------|
| `step-image-edit-2` | ~1-2s | Fast iteration, text-to-image + editing |
| `step-2x-large` | ~10-20s | High quality, image-to-image |
| `step-1x-medium` | ~10-20s | Balanced quality and speed |

## API Reference

- StepFun 开放平台: https://platform.stepfun.com
- API 文档: https://platform.stepfun.com/docs/zh/api-reference/images/image

## Development

```bash
# Install in editable mode
pip install -e .

# Run tests
python -m pytest tests/

# Build package
python -m build
```

## License

MIT

## Author

lora-sys
