告别手动点击!用Open-AutoGLM快速搭建手机AI助手
本文介绍了如何在星图GPU平台上自动化部署Open-AutoGLM – 智谱开源的手机端AI Agent框架镜像,实现自然语言驱动的手机自动化操作。用户可快速搭建AI助手,典型应用场景包括跨平台比价、社交信息同步、内容封面保存等高频手机任务,显著提升日常数字生活效率。
Z-Image-Turbo-辉夜巫女开发者指南:自定义Gradio界面+批量生成功能扩展
1. 引言:从基础使用到深度定制
如果你已经体验过Z-Image-Turbo-辉夜巫女模型的基础功能,可能会发现一个问题:虽然模型生成辉夜巫女图片的效果很棒,但每次只能生成一张图片,而且界面功能相对简单。当你想批量生成不同风格、不同姿势的辉夜巫女图片时,就需要反复手动操作,效率很低。
这正是我们今天要解决的问题。本文将带你从基础的模型部署开始,一步步教你如何扩展Gradio界面,添加批量生成功能,打造一个真正适合开发者使用的创作工具。无论你是想为自己的项目集成这个模型,还是想提升个人创作效率,这篇指南都能给你实用的解决方案。
我会用最直白的方式讲解每个步骤,即使你之前没有太多Gradio开发经验,也能跟着做出来。我们不仅会实现功能,还会分享一些提升用户体验的小技巧,让你的界面既好用又好看。
2. 环境准备与模型确认
在开始扩展功能之前,我们需要先确保基础环境已经正确搭建。这个步骤很重要,就像盖房子要先打好地基一样。
2.1 检查模型服务状态
首先,我们需要确认模型服务已经正常启动。打开终端,运行以下命令:
cat /root/workspace/xinference.log
如果看到类似下面的输出,说明模型启动成功:
INFO: Uvicorn running on http://0.0.0.0:9997 (Press CTRL+C to quit)
INFO: Started server process [1234]
INFO: Waiting for application startup.
INFO: Application startup complete.
这里的关键是看到“Application startup complete”和端口号(通常是9997)。如果服务没有启动,你可能需要重新启动容器或者检查配置。
2.2 访问基础Web界面
模型启动成功后,我们可以在CSDN星图镜像中找到WebUI入口。点击进入后,你会看到一个简单的界面,包含以下几个部分:
- 提示词输入框:输入你想要生成图片的描述
- 生成按钮:点击后开始生成图片
- 图片显示区域:显示生成的图片
基础界面虽然简单,但能验证模型是否正常工作。你可以先输入“辉夜巫女”测试一下,看看生成效果如何。如果能看到一张辉夜巫女的图片,说明一切正常,我们可以开始扩展功能了。
3. Gradio界面基础扩展
Gradio是一个很好用的Python库,可以快速构建机器学习应用的Web界面。我们先从一些基础扩展开始,让界面更加友好。
3.1 安装必要的依赖
首先,确保你的环境中已经安装了必要的包。如果使用CSDN星图镜像,这些通常已经预装了,但我们可以检查一下:
# 检查Gradio版本
import gradio as gr
print(f"Gradio版本: {gr.__version__}")
# 如果需要安装或升级
# !pip install gradio --upgrade
3.2 创建自定义界面脚本
我们在/root/workspace目录下创建一个新的Python脚本,比如叫custom_ui.py:
import gradio as gr
import requests
import json
import base64
from io import BytesIO
from PIL import Image
# 模型服务的地址
MODEL_URL = "http://localhost:9997/v1/images/generations"
def generate_single_image(prompt, negative_prompt="", steps=20, guidance_scale=7.5):
"""生成单张图片的基础函数"""
payload = {
"model": "z-image-turbo-huiye",
"prompt": prompt,
"negative_prompt": negative_prompt,
"num_inference_steps": steps,
"guidance_scale": guidance_scale,
"width": 512,
"height": 512,
"num_images": 1
}
headers = {"Content-Type": "application/json"}
try:
response = requests.post(MODEL_URL, json=payload, headers=headers)
if response.status_code == 200:
result = response.json()
# 解析base64图片数据
image_data = base64.b64decode(result["data"][0]["b64_json"])
image = Image.open(BytesIO(image_data))
return image
else:
return None
except Exception as e:
print(f"生成图片时出错: {e}")
return None
这个基础函数封装了调用模型API的逻辑。我们添加了一些参数:
negative_prompt:不希望出现在图片中的内容steps:生成步数,影响图片质量guidance_scale:指导尺度,影响生成结果与提示词的贴合程度
3.3 构建基础界面
有了生成函数,我们可以构建一个比默认界面更丰富的Gradio界面:
def create_basic_interface():
"""创建基础扩展界面"""
with gr.Blocks(title="辉夜巫女图片生成器 - 增强版", theme=gr.themes.Soft()) as demo:
gr.Markdown("# 🎨 辉夜巫女图片生成器")
gr.Markdown("### 使用Z-Image-Turbo模型生成高质量的辉夜巫女图片")
with gr.Row():
with gr.Column(scale=2):
# 输入区域
prompt_input = gr.Textbox(
label="提示词",
placeholder="例如:辉夜巫女在樱花树下,穿着传统巫女服,微笑",
lines=3
)
negative_input = gr.Textbox(
label="负面提示词(可选)",
placeholder="例如:模糊,低质量,变形",
lines=2
)
with gr.Row():
steps_slider = gr.Slider(
minimum=10, maximum=50, value=20, step=1,
label="生成步数"
)
guidance_slider = gr.Slider(
minimum=1.0, maximum=15.0, value=7.5, step=0.5,
label="指导尺度"
)
generate_btn = gr.Button("生成图片", variant="primary")
with gr.Column(scale=3):
# 输出区域
output_image = gr.Image(label="生成的图片", type="pil")
# 绑定事件
generate_btn.click(
fn=generate_single_image,
inputs=[prompt_input, negative_input, steps_slider, guidance_slider],
outputs=output_image
)
# 示例提示词
gr.Examples(
examples=[
["辉夜巫女在神社前祈祷,阳光透过树叶洒下"],
["辉夜巫女手持御币,表情严肃,背景是满月"],
["辉夜巫女穿着红色巫女服,在枫叶中跳舞"],
["辉夜巫女在夜晚的庭院中,周围有萤火虫"]
],
inputs=prompt_input,
label="示例提示词(点击使用)"
)
return demo
if __name__ == "__main__":
demo = create_basic_interface()
demo.launch(server_name="0.0.0.0", server_port=7860, share=False)
这个界面相比默认界面有几个改进:
- 添加了负面提示词输入
- 可以调整生成步数和指导尺度
- 提供了示例提示词,点击就能使用
- 界面布局更加美观合理
运行这个脚本,你就能看到一个功能更丰富的界面了。
4. 实现批量生成功能
现在进入核心部分:批量生成功能。这个功能能让你一次性生成多张图片,大大提高效率。
4.1 批量生成函数
我们先创建一个批量生成的函数:
import time
from concurrent.futures import ThreadPoolExecutor, as_completed
def generate_batch_images(prompts_list, negative_prompt="", steps=20, guidance_scale=7.5, max_workers=2):
"""批量生成多张图片
Args:
prompts_list: 提示词列表,每个元素是一个提示词字符串
negative_prompt: 负面提示词
steps: 生成步数
guidance_scale: 指导尺度
max_workers: 最大并发数,根据你的硬件调整
"""
results = []
errors = []
def generate_one(prompt, index):
"""生成单张图片的辅助函数"""
try:
print(f"正在生成第 {index + 1} 张图片: {prompt[:30]}...")
start_time = time.time()
payload = {
"model": "z-image-turbo-huiye",
"prompt": prompt,
"negative_prompt": negative_prompt,
"num_inference_steps": steps,
"guidance_scale": guidance_scale,
"width": 512,
"height": 512,
"num_images": 1
}
headers = {"Content-Type": "application/json"}
response = requests.post(MODEL_URL, json=payload, headers=headers)
if response.status_code == 200:
result = response.json()
image_data = base64.b64decode(result["data"][0]["b64_json"])
image = Image.open(BytesIO(image_data))
# 添加元数据
image.info["prompt"] = prompt
image.info["index"] = index
image.info["time"] = time.time() - start_time
return {"success": True, "image": image, "index": index, "prompt": prompt}
else:
return {"success": False, "error": f"API返回错误: {response.status_code}", "index": index}
except Exception as e:
return {"success": False, "error": str(e), "index": index}
# 使用线程池并发生成
with ThreadPoolExecutor(max_workers=max_workers) as executor:
future_to_index = {
executor.submit(generate_one, prompt, i): i
for i, prompt in enumerate(prompts_list)
}
for future in as_completed(future_to_index):
result = future.result()
if result["success"]:
results.append(result)
print(f"✓ 第 {result['index'] + 1} 张图片生成完成,耗时: {result['image'].info['time']:.2f}秒")
else:
errors.append(result)
print(f"✗ 第 {result['index'] + 1} 张图片生成失败: {result['error']}")
# 按原始顺序排序
results.sort(key=lambda x: x["index"])
return {
"images": [r["image"] for r in results],
"success_count": len(results),
"error_count": len(errors),
"errors": errors
}
这个函数有几个关键点:
- 支持并发生成,可以同时生成多张图片
- 每张图片都记录了生成时间和使用的提示词
- 有完善的错误处理机制
- 返回详细的生成结果统计
4.2 批量生成界面
现在我们来创建一个专门的批量生成界面:
def create_batch_interface():
"""创建批量生成界面"""
with gr.Blocks(title="辉夜巫女批量生成器", theme=gr.themes.Soft()) as demo:
gr.Markdown("# 🔄 辉夜巫女图片批量生成器")
gr.Markdown("### 一次性生成多张不同风格的辉夜巫女图片")
with gr.Row():
with gr.Column(scale=1):
# 批量输入区域
gr.Markdown("### 批量提示词输入")
gr.Markdown("每行一个提示词,将按顺序生成图片")
batch_prompts = gr.Textbox(
label="批量提示词",
placeholder="例如:\n辉夜巫女在樱花树下\n辉夜巫女在神社祈祷\n辉夜巫女手持御币\n辉夜巫女在夜晚庭院",
lines=10
)
# 批量生成设置
with gr.Accordion("高级设置", open=False):
batch_negative = gr.Textbox(
label="负面提示词(应用于所有图片)",
value="模糊,低质量,变形,多余的手指",
lines=2
)
batch_steps = gr.Slider(
minimum=10, maximum=50, value=20, step=1,
label="生成步数"
)
batch_guidance = gr.Slider(
minimum=1.0, maximum=15.0, value=7.5, step=0.5,
label="指导尺度"
)
batch_workers = gr.Slider(
minimum=1, maximum=4, value=2, step=1,
label="并发数量(根据硬件调整)"
)
batch_btn = gr.Button("开始批量生成", variant="primary", size="lg")
# 进度和统计
progress_text = gr.Textbox(label="生成进度", interactive=False)
stats_text = gr.Textbox(label="生成统计", interactive=False)
with gr.Column(scale=2):
# 批量输出区域
gr.Markdown("### 生成结果")
batch_gallery = gr.Gallery(
label="批量生成结果",
show_label=True,
columns=3,
rows=2,
height="auto"
)
# 批量生成函数
def run_batch_generation(prompts_text, negative, steps, guidance, workers):
"""执行批量生成"""
if not prompts_text.strip():
return [], "请输入提示词", "等待开始..."
# 解析提示词列表
prompts_list = [p.strip() for p in prompts_text.split('\n') if p.strip()]
total = len(prompts_list)
yield [], f"准备生成 {total} 张图片...", "等待开始..."
# 执行批量生成
result = generate_batch_images(
prompts_list=prompts_list,
negative_prompt=negative,
steps=steps,
guidance_scale=guidance,
max_workers=workers
)
# 准备统计信息
stats = f"""
✅ 生成完成!
总计: {total} 张
成功: {result['success_count']} 张
失败: {result['error_count']} 张
点击图片可以查看大图,右键可以保存图片。
"""
if result['errors']:
error_details = "\n".join([f"第{e['index']+1}张: {e['error']}" for e in result['errors']])
stats += f"\n\n失败详情:\n{error_details}"
yield result['images'], "批量生成完成!", stats
# 绑定事件
batch_btn.click(
fn=run_batch_generation,
inputs=[batch_prompts, batch_negative, batch_steps, batch_guidance, batch_workers],
outputs=[batch_gallery, progress_text, stats_text]
)
# 批量示例
batch_examples = [
"""辉夜巫女在樱花树下,微笑
辉夜巫女在神社祈祷,表情虔诚
辉夜巫女手持御币,施放法术
辉夜巫女在夜晚庭院,周围有萤火虫
辉夜巫女穿着红色巫女服,在枫叶中
辉夜巫女在雨中,手持油纸伞""",
"""辉夜巫女战斗姿态,手持符咒
辉夜巫女在月下跳舞
辉夜巫女照顾神社的小动物
辉夜巫女制作护身符
辉夜巫女在清晨打扫神社"""
]
gr.Examples(
examples=batch_examples,
inputs=batch_prompts,
label="批量示例(点击使用)"
)
return demo
这个批量生成界面提供了:
- 多行文本输入,每行一个提示词
- 并发控制,可以根据硬件调整同时生成的数量
- 实时进度显示和统计信息
- 图片画廊展示所有生成结果
- 预设的批量示例,方便快速开始
5. 高级功能与优化
基础功能和批量功能都有了,我们还可以添加一些高级功能来提升体验。
5.1 图片后处理功能
有时候生成的图片可能需要一些简单的调整,我们可以添加基本的图片处理功能:
from PIL import ImageOps, ImageFilter
def add_image_processing_tab():
"""添加图片处理功能"""
def process_image(image, operation, parameter=None):
"""处理单张图片"""
if image is None:
return None
try:
if operation == "resize":
# 调整大小
if parameter:
width, height = map(int, parameter.split('x'))
return image.resize((width, height), Image.Resampling.LANCZOS)
return image
elif operation == "rotate":
# 旋转
angle = int(parameter) if parameter else 90
return image.rotate(angle, expand=True)
elif operation == "flip":
# 翻转
if parameter == "horizontal":
return ImageOps.mirror(image)
else: # vertical
return ImageOps.flip(image)
elif operation == "enhance":
# 增强对比度
from PIL import ImageEnhance
enhancer = ImageEnhance.Contrast(image)
factor = float(parameter) if parameter else 1.5
return enhancer.enhance(factor)
elif operation == "blur":
# 模糊效果
radius = int(parameter) if parameter else 2
return image.filter(ImageFilter.GaussianBlur(radius))
else:
return image
except Exception as e:
print(f"图片处理出错: {e}")
return image
# 创建处理界面
with gr.Blocks() as processing_tab:
gr.Markdown("### 🛠️ 图片后处理")
gr.Markdown("对生成的图片进行简单处理")
with gr.Row():
with gr.Column():
input_image = gr.Image(label="原始图片", type="pil")
operation = gr.Radio(
choices=["resize", "rotate", "flip", "enhance", "blur"],
label="处理操作",
value="resize"
)
param_input = gr.Textbox(
label="参数(可选)",
placeholder="例如:1024x1024(调整大小)或 90(旋转角度)",
lines=1
)
process_btn = gr.Button("处理图片", variant="secondary")
with gr.Column():
output_image = gr.Image(label="处理后的图片", type="pil")
# 示例参数
gr.Examples(
examples=[
["resize", "1024x1024"],
["rotate", "45"],
["flip", "horizontal"],
["enhance", "1.8"],
["blur", "3"]
],
inputs=[operation, param_input],
label="处理示例"
)
# 绑定事件
process_btn.click(
fn=process_image,
inputs=[input_image, operation, param_input],
outputs=output_image
)
return processing_tab
5.2 提示词模板功能
对于经常使用的场景,我们可以创建提示词模板:
def create_prompt_templates():
"""创建提示词模板功能"""
templates = {
"神社场景": "辉夜巫女在{location},{action},{time},{weather}",
"战斗姿态": "辉夜巫女{pose},手持{weapon},{expression},背景是{background}",
"日常场景": "辉夜巫女在{location}{action},穿着{clothing},{mood}",
"节日庆典": "辉夜巫女参加{event},穿着{clothing},{action},周围有{decorations}"
}
template_vars = {
"location": ["神社前", "庭院中", "樱花树下", "枫叶林", "竹林", "湖边"],
"action": ["祈祷", "跳舞", "施法", "打扫", "休息", "练习"],
"time": ["清晨", "正午", "黄昏", "夜晚", "月夜"],
"weather": ["晴天", "雨天", "雪天", "雾天", "星空下"],
"pose": ["战斗姿态", "防御姿态", "施法姿态", "祈祷姿态"],
"weapon": ["御币", "符咒", "法杖", "剑", "弓箭"],
"expression": ["表情严肃", "眼神坚定", "面带微笑", "神情专注"],
"background": ["满月", "星空", "神社", "森林", "山脉"],
"clothing": ["传统巫女服", "红色巫女服", "白色巫女服", "正式巫女装束"],
"mood": ["心情愉快", "神情平静", "略带忧伤", "充满活力"],
"event": ["新年祭典", "夏日祭",秋日祭典", "神乐舞表演"],
"decorations": ["灯笼", "彩带", "旗帜", "花朵", "烟火"]
}
def generate_from_template(template_type, **selections):
"""从模板生成提示词"""
template = templates[template_type]
# 替换变量
for key, value in selections.items():
if key in template_vars and value in template_vars[key]:
template = template.replace(f"{{{key}}}", value)
# 替换未选择的变量
import random
for var in ["location", "action", "time", "weather", "pose", "weapon",
"expression", "background", "clothing", "mood", "event", "decorations"]:
if f"{{{var}}}" in template:
options = template_vars.get(var, [f"{var}选项"])
template = template.replace(f"{{{var}}}", random.choice(options))
return template
# 创建模板界面
with gr.Blocks() as template_tab:
gr.Markdown("### 📝 提示词模板")
gr.Markdown("使用模板快速生成多样化的提示词")
template_type = gr.Dropdown(
choices=list(templates.keys()),
label="选择模板类型",
value="神社场景"
)
# 动态创建变量选择器
variable_inputs = {}
with gr.Row():
for var in ["location", "action", "time", "weather"]:
variable_inputs[var] = gr.Dropdown(
choices=template_vars.get(var, []),
label=var,
value=None,
allow_custom_value=True
)
generate_template_btn = gr.Button("生成提示词", variant="secondary")
template_output = gr.Textbox(label="生成的提示词", lines=3)
use_template_btn = gr.Button("使用此提示词生成", variant="primary")
# 更新变量选项
def update_variables(template_name):
"""根据模板类型更新变量选项"""
template_text = templates[template_name]
variables = []
# 提取模板中的变量
import re
found_vars = re.findall(r'{(\w+)}', template_text)
updates = []
for var in ["location", "action", "time", "weather", "pose", "weapon",
"expression", "background", "clothing", "mood", "event", "decorations"]:
if var in found_vars:
updates.append(gr.update(choices=template_vars.get(var, []), visible=True))
else:
updates.append(gr.update(visible=False))
return updates
# 生成提示词
def generate_prompt(template_name, **kwargs):
"""生成提示词"""
selections = {k: v for k, v in kwargs.items() if v}
prompt = generate_from_template(template_name, **selections)
return prompt
# 绑定事件
template_type.change(
fn=update_variables,
inputs=template_type,
outputs=list(variable_inputs.values())
)
generate_template_btn.click(
fn=generate_prompt,
inputs=[template_type] + list(variable_inputs.values()),
outputs=template_output
)
return template_tab
6. 整合完整应用
现在我们把所有功能整合到一个完整的应用中:
def create_complete_application():
"""创建完整的应用程序"""
with gr.Blocks(
title="辉夜巫女图片生成工作室",
theme=gr.themes.Soft(),
css="""
.gradio-container {max-width: 1200px !important;}
.tab-nav {font-weight: bold;}
.success {color: #28a745;}
.error {color: #dc3545;}
"""
) as demo:
gr.Markdown("# 🎨 辉夜巫女图片生成工作室")
gr.Markdown("### 基于Z-Image-Turbo模型的全功能图片生成工具")
# 创建标签页
with gr.Tabs() as tabs:
# 标签页1: 单张生成
with gr.TabItem("🖼️ 单张生成", id="single"):
single_demo = create_basic_interface()
# 将单张生成的组件移到当前上下文
# 这里需要将create_basic_interface函数的内容直接整合进来
# 为了简洁,我们使用一个简化版本
with gr.Column():
prompt = gr.Textbox(label="提示词", lines=3)
generate_btn = gr.Button("生成")
output = gr.Image(label="结果")
def generate_single(p):
return generate_single_image(p)
generate_btn.click(generate_single, prompt, output)
# 标签页2: 批量生成
with gr.TabItem("🔄 批量生成", id="batch"):
batch_demo = create_batch_interface()
# 同样需要整合,这里展示关键组件
batch_prompts = gr.Textbox(label="批量提示词", lines=10)
batch_btn = gr.Button("批量生成")
batch_gallery = gr.Gallery()
def run_batch(prompts_text):
prompts_list = [p.strip() for p in prompts_text.split('\n') if p.strip()]
result = generate_batch_images(prompts_list, max_workers=2)
return result['images']
batch_btn.click(run_batch, batch_prompts, batch_gallery)
# 标签页3: 提示词模板
with gr.TabItem("📝 提示词模板", id="templates"):
template_tab = create_prompt_templates()
# 标签页4: 图片处理
with gr.TabItem("🛠️ 图片处理", id="processing"):
processing_tab = add_image_processing_tab()
# 标签页5: 使用指南
with gr.TabItem("📖 使用指南", id="guide"):
gr.Markdown("""
## 使用指南
### 单张生成
1. 在提示词框中输入描述
2. 调整参数(可选)
3. 点击"生成图片"按钮
### 批量生成
1. 在批量提示词框中,每行输入一个提示词
2. 设置生成参数
3. 点击"开始批量生成"
4. 查看生成结果和统计信息
### 提示词技巧
- 描述越详细,生成效果越好
- 使用负面提示词排除不想要的内容
- 尝试不同的风格词汇:动漫风格、写实风格、水彩风格等
### 常见问题
- **生成速度慢**:减少并发数量或降低生成步数
- **图片质量不高**:增加生成步数,提供更详细的描述
- **内存不足**:减少同时生成的数量
### 性能建议
- 批量生成时,建议并发数设为2-3
- 生成步数20-30之间效果和速度比较平衡
- 复杂的提示词需要更多生成步数
""")
# 添加页脚
gr.Markdown("---")
gr.Markdown("""
### 使用提示
- 生成的图片可以右键保存
- 批量生成时建议先测试单张效果
- 不同的提示词组合会产生意想不到的效果
- 遇到问题可以查看控制台日志
""")
return demo
# 启动完整应用
if __name__ == "__main__":
# 创建完整的应用
app = create_complete_application()
# 启动服务
print("正在启动辉夜巫女图片生成工作室...")
print("访问地址: http://localhost:7860")
print("按 Ctrl+C 停止服务")
app.launch(
server_name="0.0.0.0",
server_port=7860,
share=False,
show_error=True,
debug=False
)
7. 部署与使用建议
7.1 部署步骤
-
保存脚本:将上面的代码保存为
huiye_studio.py -
安装依赖(如果尚未安装):
pip install gradio pillow requests
- 启动服务:
python huiye_studio.py
- 访问应用:在浏览器中打开
http://你的服务器IP:7860
7.2 性能优化建议
根据你的硬件配置,可以调整以下参数:
# 在批量生成函数中调整这些参数
MAX_WORKERS = 2 # 并发数,根据CPU核心数调整
BATCH_TIMEOUT = 30 # 单张图片生成超时时间
IMAGE_SIZE = (512, 512) # 图片尺寸,越大需要的内存越多
# 在Gradio启动时调整
app.launch(
max_file_size="20MB", # 上传文件大小限制
allowed_paths=["."], # 允许访问的路径
prevent_thread_lock=True # 防止线程锁定
)
7.3 扩展建议
如果你需要进一步扩展这个应用,可以考虑:
- 添加模型管理:支持切换不同的模型
- 添加历史记录:保存生成记录和参数
- 添加用户系统:多用户支持
- 添加API接口:提供REST API供其他程序调用
- 添加更多后处理功能:滤镜、调色、合成等
8. 总结
通过本文的指南,我们成功将基础的Z-Image-Turbo-辉夜巫女模型服务扩展成了一个功能丰富的图片生成工作室。我们从简单的单张生成开始,逐步添加了批量生成、图片处理、提示词模板等实用功能。
关键改进包括:
- 批量生成功能:可以一次性生成多张图片,大幅提升效率
- 友好的界面:使用Gradio构建了直观易用的Web界面
- 并发处理:利用多线程同时生成多张图片
- 错误处理:完善的错误处理和进度反馈
- 扩展性:模块化设计,方便添加新功能
这个方案的优势在于:
- 易于部署:只需要Python和几个基础库
- 资源友好:可以根据硬件调整并发数
- 灵活扩展:可以轻松添加新功能
- 用户友好:不需要编程知识就能使用
无论你是想快速生成一批辉夜巫女图片用于创作,还是想学习如何扩展AI模型的应用界面,这个方案都提供了一个很好的起点。你可以基于这个框架继续添加更多功能,比如风格迁移、图片编辑、批量下载等,打造属于自己的AI创作工具。
获取更多AI镜像
想探索更多AI镜像和应用场景?访问 CSDN星图镜像广场,提供丰富的预置镜像,覆盖大模型推理、图像生成、视频生成、模型微调等多个领域,支持一键部署。
更多推荐




所有评论(0)