freegen-app
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "freegen-app" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-a63c45bc266d3a9c3e5e036b8882706387a8974dc0b65842ac054aad166eb496. Verify the upstream source and version against https://skillhub.cn/skills/user_b22a52ba/freegen-app before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Generate AI images using the free API of FreeGen.app, creating image requests based on the interface and parameters provided by FreeGen.app.
Introduction source: third_party · user_b22a52ba · 2.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Audience
- Not specified in the source documentation.
- Inputs and outputs
- Not specified in the source documentation.
- Software, accounts and paid services
- Translation pending; see source documentation.
- Limits and differences
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: freegen-app
description: 使用 FreeGen.app (https://freegen.app/) 的免费 API 生成 AI 图片。基于 Z-Image Turbo
模型,支持文生图 (Text-to-Image) 和图生图 (Image-to-Image),无需注册、无需 API Key、完全免费无限次。支持多种宽高比 (1:1,
4:3, 3:4, 16:9, 9:16)。通过 WebSocket 实时获取生成结果。触发关键词:freegen、FreeGen、免费生图、Z-Image Turbo、freegen.app、免费AI绘图。
version: 2.0.0
tags:
- freegen
slug: freegen-app
displayName: Freegen App
summary: 使用 FreeGen.app (https://freegen.app/) 的免费 API 生成 AI 图片FreeGen.app 免费AI图片生成技能
概述
FreeGen.app 提供完全免费的 AI 图片生成服务,使用阿里 Z-Image Turbo 模型。无需注册、无需 API Key、无限次使用。
核心功能:
- 文生图 (Text-to-Image):输入文字描述生成图片
- 图生图 (Image-to-Image):上传参考图片进行 AI 变换
- 多宽高比:1:1(方形)、4:3(横版)、3:4(竖版)、16:9(宽屏)、9:16(竖屏/手机壁纸)
- WebSocket 实时推送:生成完成后通过 WebSocket 即时返回图片
- 输出分辨率:默认 1024x768
API 架构
FreeGen.app 采用三步请求架构:
1. Prompt Signer (签名) → 获取时间戳和签名
2. Image Generator (生图) → 提交任务,获取 job_id
3. WebSocket Bridge (结果) → 通过 WS 订阅任务结果
| 服务 | 端点 | 说明 |
|---|---|---|
| Prompt Signer | https://prompt-signer.freegen.app |
对 prompt 签名,防滥用 |
| Image Generator | https://image-generator.freegen.app |
提交生图任务 |
| WebSocket Bridge | wss://websocket-bridge.freegen.app/ws |
实时获取生成结果 |
| Stats API | https://stats.freegen.app |
统计记录(非必需) |
Python 实现
依赖
import requests
import json
import asyncio
import websockets
import hashlib
import base64
import time
import os
from pathlib import Path
如需 WebSocket 支持,确保已安装:
pip install websockets
核心函数
SIGNER_URL = "https://prompt-signer.freegen.app"
GENERATOR_URL = "https://image-generator.freegen.app"
WEBSOCKET_URL = "wss://websocket-bridge.freegen.app/ws"
async def create_ws_auth(job_id: str) -> str:
"""生成 WebSocket 认证 token(与前端逻辑一致)"""
timestamp = int(time.time())
message = f"{job_id}{timestamp}"
hash_hex = hashlib.sha256(message.encode()).hexdigest()
token = base64.b64encode(hash_hex.encode()).decode()[:20]
return f"{token}:{timestamp}"
async def generate_image(
prompt: str,
ratio: str = "4:3",
image_data: str = None,
timeout: int = 120,
output_path: str = None,
) -> str:
"""
生成 AI 图片
Args:
prompt: 文字描述(英文效果最佳)
ratio: 宽高比,可选 "1:1" / "4:3" / "3:4" / "16:9" / "9:16"
image_data: 可选,参考图片的 base64 data URL(用于图生图)
timeout: 超时秒数(默认 120)
output_path: 保存路径(默认自动生成)
Returns:
保存的图片文件路径
Raises:
Exception: 生成失败或超时
"""
# Step 1: 获取签名
signer_res = requests.post(
SIGNER_URL,
headers={"Content-Type": "application/json"},
json={"prompt": prompt}
)
if signer_res.status_code == 429:
raise Exception("请求过于频繁,请稍后再试")
signer_res.raise_for_status()
signer_data = signer_res.json()
ts = signer_data["ts"]
sig = signer_data["sig"]
# Step 2: 提交生图任务
body = {
"prompt": prompt,
"ts": ts,
"sig": sig,
"ratio_id": ratio,
}
if image_data:
body["image_data"] = image_data
gen_res = requests.post(
GENERATOR_URL,
headers={"Content-Type": "application/json"},
json=body
)
if gen_res.status_code == 429:
raise Exception("生成请求过于频繁,请稍后再试")
gen_res.raise_for_status()
gen_data = gen_res.json()
# 判断是新版(job_id + WebSocket)还是旧版(直接返回图片)
if "job_id" in gen_data:
# Step 3: 通过 WebSocket 等待结果
job_id = gen_data["job_id"]
auth = await create_ws_auth(job_id)
image_url = await asyncio.wait_for(
_wait_for_ws_result(job_id, auth, timeout),
timeout=timeout
)
elif "image_data_url" in gen_data:
image_url = gen_data["image_data_url"]
else:
raise Exception("生成器返回了未知响应格式")
# 下载图片(WebSocket 返回的可能是 base64 data URL)
if image_url.startswith("data:"):
import base64 as b64
_, b64data = image_url.split(",", 1)
img_bytes = b64.b64decode(b64data)
else:
img_res = requests.get(image_url, timeout=30)
img_res.raise_for_status()
img_bytes = img_res.content
if not output_path:
workspace = os.getenv("WORKSPACE_DIR", ".")
os.makedirs(os.path.join(workspace, "output"), exist_ok=True)
output_path = os.path.join(workspace, "output", f"freegen_{int(time.time())}.jpg")
Path(output_path).write_bytes(img_bytes)
return output_path
async def _wait_for_ws_result(job_id: str, auth: str, timeout: int) -> str:
"""通过 WebSocket 等待图片生成结果"""
try:
async with websockets.connect(WEBSOCKET_URL) as ws:
# 订阅任务
await ws.send(json.dumps({
"type": "subscribe",
"job_id": job_id,
"auth": auth
}))
while True:
try:
raw = await asyncio.wait_for(ws.recv(), timeout=timeout)
msg = json.loads(raw)
if msg.get("type") == "result":
return msg["image_data"]
elif msg.get("type") == "error":
raise Exception(msg.get("message", "图片生成失败"))
# type == "status" 仅日志记录,继续等待
except asyncio.TimeoutError:
raise Exception(f"等待生成结果超时({timeout}秒)")
except Exception as e:
raise Exception(f"WebSocket 连接失败: {e}")
使用示例
# 文生图
path = await generate_image(
prompt="A beautiful sunset over the ocean with golden reflections",
ratio="16:9"
)
print(f"图片已保存: {path}")
# 图生图(需要先将图片转为 base64 data URL)
import base64
def image_to_data_url(path: str) -> str:
with open(path, "rb") as f:
b64 = base64.b64encode(f.read()).decode()
return f"data:image/jpeg;base64,{b64}"
ref_image = image_to_data_url("reference.jpg")
path = await generate_image(
prompt="Transform into watercolor painting style",
ratio="1:1",
image_data=ref_image
)
宽高比映射
| ratio_id | 描述 | 典型用途 |
|---|---|---|
1:1 |
正方形 | 头像、社交媒体帖子 |
4:3 |
横版经典 | 默认、通用场景 |
3:4 |
竖版经典 | 竖版海报、小红书 |
16:9 |
宽屏 | 桌面壁纸、横屏视频封面 |
9:16 |
竖屏 | 手机壁纸、抖音/TikTok |
注意事项
- 英文 prompt 效果最佳:Z-Image Turbo 模型对英文理解更好,建议用英文描述
- 图生图图片限制:前端会将参考图片 resize 到最大 512px(宽或高),建议在 Skill 中同样处理
- 速率限制:频繁请求可能触发 429 错误,建议每次生成间隔 2-3 秒
- 完全免费:无注册、无 API Key、无隐藏费用
- 生成时间:通常 10 秒内完成,WebSocket 实时推送结果
- 输出格式:生成的图片 URL 是临时链接,应及时下载保存
Fallback 机制
如果 WebSocket 连接失败,generator 可能直接在 JSON 响应中返回 image_data_url(旧版模式)。代码已内置自动检测:有 job_id 走 WebSocket,有 image_data_url 直接使用。
Current listing version
2.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供完全免费的 AI 图片生成服务,无需注册和 API Key,解决用户高频刚需
- 支持文生图、图生图及多种宽高比,功能完整且实用
Areas to improve
-
description写错位置 Reported severity: Minor
顶层 frontmatter 中 description 字段为空,实际描述内容位于 skill_body 内部
Recommendation: 建议将 description 内容移至顶层 frontmatter 的 description 字段,以符合规范
Highlights
- 触发词覆盖全面,包含 freegen、FreeGen、免费生图、Z-Image Turbo 等多个精准关键词
Areas to improve
-
缺少When to Use显式章节 Reported severity: Minor
文档未设置显式的 When to Use 章节,但概述部分已涵盖使用场景
Recommendation: 建议增加 When to Use 章节以进一步提升结构规范性
Highlights
- 文档结构清晰,分概述、API 架构、Python 实现、使用示例等完整章节
- 提供端到端代码示例和宽高比映射表,便于用户理解和使用
Highlights
- API 来源明确,参数设计合理,覆盖 429 限流、超时等主要异常场景
- 内置 WebSocket Fallback 机制,提升执行鲁棒性
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Read local files
Limit access to selected files or the project directory. Avoid unrelated private records, secrets and configuration files.
Mentioned in main document · lines 211 -
Save or modify files
Confirm the output directory and whether existing files will be replaced. Back up important files and prefer a new output directory.
Mentioned in main document · lines 167 -
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 62 -
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 4, 18, 238
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- freegen.app
- image-generator.freegen.app
- prompt-signer.freegen.app
- stats.freegen.app
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Translation pending; see source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.