npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

koishi-plugin-idlecloud-img2img

v1.0.0

Published

基于 IDLECLOUD API 的图像生成插件,支持文生图和图生图功能

Readme

IDLECLOUD 图像生成 Koishi 插件

基于 IDLECLOUD API 的图像生成插件,支持文生图和图生图功能。

功能特性

  • 🎨 支持文生图(Text to Image)功能
  • 🖼️ 支持图生图(Image to Image)功能
  • 📝 自定义提示词和负面提示词
  • ⚙️ 可调节生成参数(模型、步数、引导强度、种子等)
  • 🚫 请求频率限制保护
  • 🔧 完善的错误处理
  • 📱 响应式交互体验

安装

  1. 在 Koishi 项目中安装插件:
npm install koishi-plugin-idlecloud-img2img
  1. 在 Koishi 配置文件中添加插件:
plugins:
  idlecloud-img2img:
    apiKey: "your_api_key_here"
    # 其他可选配置...

配置

必需配置

| 配置项 | 类型 | 说明 | |--------|------|------| | apiKey | string | IDLECLOUD API Key |

可选配置

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | baseUrl | string | https://image.idlecloud.cc/api | API 基础地址 | | defaultModel | string | nai-diffusion-3 | 默认模型 | | defaultSteps | number | 28 | 默认采样步数 | | defaultScale | number | 5.5 | 默认提示词引导强度 | | requestInterval | number | 20000 | 请求间隔(毫秒) |

使用方法

文生图(Text to Image)

# 基础用法
.txt2img 1girl, beautiful, anime style

# 高级用法
.txt2img -n "bad quality, blurry" -m nai-diffusion-3 -s 30 -c 7.0 masterpiece

图生图(Image to Image)

# 基础用法
.img2img [图片] 1girl, beautiful, anime style

# 高级用法
.img2img -n "bad quality" -m nai-diffusion-4-5-full [图片] high quality

命令列表

| 命令 | 说明 | 示例 | |------|------|------| | .txt2img | 文生图主命令 | .txt2img 1girl, beautiful | | .img2img | 图生图主命令 | .img2img [图片] 1girl, beautiful | | .ai-models | 查看支持的模型列表 | .ai-models | | .ai-help | 显示帮助信息 | .ai-help |

参数说明

| 参数 | 说明 | 示例 | |------|------|------| | -n <text> | 负面提示词 | -n "bad quality" | | -m <text> | 模型名称 | -m nai-diffusion-3 | | -s <number> | 采样步数 | -s 28 | | -c <number> | 提示词引导强度 | -c 5.5 | | -r <number> | 随机种子 | -r 123456 |

高级用法示例

# 文生图完整示例
.txt2img -n "bad quality, blurry" -m nai-diffusion-4-5-full -s 30 -c 7.0 -r 123456 masterpiece, detailed

# 图生图完整示例  
.img2img -n "low quality" -m nai-diffusion-3 -s 28 -c 5.5 [图片] beautiful, anime style

支持的模型

  • nai-diffusion-3 - 标准模型
  • nai-diffusion-4-5-full - 完整模型
  • nai-diffusion-4-5-cautious - 谨慎模型
  • nai-diffusion-4-5-quick - 快速模型
  • nai-diffusion-4-5-reroll - 重滚模型
  • nai-diffusion-4-5-uncensored - 无审查模型

使用限制

  • ⏰ API 请求间隔至少 20 秒
  • 🔒 每个用户同时只能处理 1 个任务
  • 💰 需要订阅 ≥30元/月才能使用 API
  • 📏 图片尺寸限制为 1024x1024
  • 📝 文生图不需要上传图片,图生图需要上传图片作为输入

API Key 获取

  1. 访问 IDLECLOUD
  2. 注册并登录账号
  3. 订阅进阶档位(¥30/月)或更高
  4. 在设置中生成 API Key
  5. 将 API Key 填入插件配置

错误处理

插件包含完善的错误处理机制:

  • API Key 无效: 检查配置中的 API Key 是否正确
  • 请求频繁: 等待 20 秒后重试
  • 网络超时: 图片生成时间较长,请耐心等待
  • 订阅限制: 确保账号订阅等级符合要求
  • 图片下载失败: 检查图片链接是否有效

开发

本地开发

# 克隆项目
git clone <repository-url>
cd koishi-plugin-idlecloud-img2img

# 安装依赖
npm install

# 开发模式
npm run dev

# 构建
npm run build

项目结构

koishi-plugin-idlecloud-img2img/
├── src/
│   └── index.ts          # 主插件文件
├── package.json          # 项目配置
└── README.md            # 说明文档

许可证

MIT License

贡献

欢迎提交 Issue 和 Pull Request!

支持

如果遇到问题,请:

  1. 检查 API Key 配置是否正确
  2. 确认订阅等级是否符合要求
  3. 查看网络连接是否正常
  4. 提交 Issue 寻求帮助

注意: 本插件仅用于学习和研究目的,请遵守相关服务条款和法律法规。