造相Z-Image文生图模型v2:Python数据分析与可视化

📅 发布时间:2026/7/6 1:48:29 👁️ 浏览次数:
造相Z-Image文生图模型v2:Python数据分析与可视化
造相Z-Image文生图模型v2Python数据分析与可视化1. 为什么需要分析文生图模型的输出效果在日常使用造相Z-Image文生图模型v2的过程中我们常常会生成大量图片但很少停下来思考这些图片到底表现如何哪些提示词更有效不同参数设置对结果质量有什么影响单纯依靠肉眼观察很难得出客观结论就像厨师不能只靠尝味道来改进菜谱一样。我最近用Z-Image-Turbo生成了300多张图片从风景到人像从写实到艺术风格发现有些提示词组合总是能产出高质量作品而另一些则反复失败。这让我意识到与其凭感觉调整参数不如用数据说话——把生成过程变成可量化的实验。Python恰好提供了完美的工具链Pandas处理结构化数据Matplotlib绘制直观图表NumPy进行数值分析。通过简单的几行代码我们就能回答那些困扰创作者的实际问题什么样的提示词长度最理想不同分辨率设置对生成时间的影响有多大中文提示词和英文提示词的效果差异是否显著这些问题的答案就藏在我们每天生成的图片元数据里。2. 数据收集构建你的Z-Image效果数据库要开始分析首先得有数据。Z-Image模型本身不直接提供详细的生成日志但我们可以轻松构建自己的记录系统。每次调用API时除了获取图片URL还应该保存关键的元信息。import pandas as pd import time from datetime import datetime import json # 模拟Z-Image API调用后的数据记录 def record_generation_result(prompt, size, n, prompt_extend, generation_time, successTrue, image_urlNone, error_messageNone): 记录一次Z-Image生成操作的详细信息 record { timestamp: datetime.now().isoformat(), prompt: prompt, prompt_length: len(prompt), size: size, image_count: n, prompt_extend_enabled: prompt_extend, generation_time_seconds: round(generation_time, 2), success: success, image_url: image_url, error_message: error_message, resolution_width: int(size.split(*)[0]), resolution_height: int(size.split(*)[1]), aspect_ratio: round(int(size.split(*)[0]) / int(size.split(*)[1]), 2) } return record # 创建一个空的数据框架来存储所有记录 columns [timestamp, prompt, prompt_length, size, image_count, prompt_extend_enabled, generation_time_seconds, success, image_url, error_message, resolution_width, resolution_height, aspect_ratio] zimage_data pd.DataFrame(columnscolumns) # 示例添加几次生成记录 sample_records [ record_generation_result( 一只橘猫坐在窗台上阳光透过玻璃洒在它身上写实风格, 1024*1024, 1, True, 8.25, True, https://example.com/cat1.png ), record_generation_result( 中国山水画风格远山如黛近水含烟水墨晕染, 1280*1280, 1, False, 6.72, True, https://example.com/landscape1.png ), record_generation_result( 现代简约办公室落地窗木质办公桌绿植自然光, 1104*1472, 1, True, 9.13, True, https://example.com/office1.png ), record_generation_result( 科幻城市夜景霓虹灯飞行汽车雨天反光路面, 1472*1104, 1, True, 10.45, False, None, API timeout ) ] # 将示例记录添加到DataFrame for record in sample_records: zimage_data pd.concat([zimage_data, pd.DataFrame([record])], ignore_indexTrue) print(f已记录 {len(zimage_data)} 次Z-Image生成操作) zimage_data.head()这个基础框架可以扩展为完整的实验记录系统。实际应用中你可以在调用Z-Image API的代码中加入日志记录或者使用专门的实验跟踪工具如Weights Biases或MLflow。关键是保持数据的一致性和完整性这样后续的分析才有意义。3. Pandas数据处理从原始记录到洞察有了基础数据后Pandas就是我们的瑞士军刀。让我们看看如何从这些看似普通的记录中挖掘出有价值的见解。3.1 数据清洗与特征工程首先处理缺失值和异常值然后创建更有意义的特征import numpy as np import matplotlib.pyplot as plt import seaborn as sns # 数据清洗 zimage_clean zimage_data.copy() # 处理缺失值 zimage_clean[generation_time_seconds] zimage_clean[generation_time_seconds].fillna( zimage_clean[generation_time_seconds].median() ) zimage_clean[success] zimage_clean[success].fillna(False) # 创建新特征 zimage_clean[prompt_category] zimage_clean[prompt].apply( lambda x: animal if 猫 in x or dog in x.lower() else landscape if 山水 in x or 风景 in x or landscape in x.lower() else architecture if 建筑 in x or 办公室 in x or office in x.lower() else people if 人 in x or 人物 in x or portrait in x.lower() else other ) zimage_clean[resolution_area] zimage_clean[resolution_width] * zimage_clean[resolution_height] zimage_clean[is_square] (zimage_clean[resolution_width] zimage_clean[resolution_height]) # 查看数据概览 print(数据概览:) print(zimage_clean.describe()) print(\n成功生成比例:, zimage_clean[success].mean()) print(\n提示词长度分布:) print(zimage_clean[prompt_length].describe())3.2 关键指标分析现在让我们深入分析几个创作者最关心的问题# 分析提示词长度与生成成功率的关系 plt.figure(figsize(12, 8)) # 子图1提示词长度分布 plt.subplot(2, 2, 1) zimage_clean[prompt_length].hist(bins20, alpha0.7, colorskyblue) plt.title(提示词长度分布) plt.xlabel(字符数) plt.ylabel(频次) # 子图2提示词长度与成功率关系 plt.subplot(2, 2, 2) length_bins pd.cut(zimage_clean[prompt_length], bins10) success_by_length zimage_clean.groupby(length_bins)[success].mean() success_by_length.plot(kindbar, colorlightcoral, alpha0.7) plt.title(提示词长度与生成成功率) plt.xlabel(提示词长度区间) plt.ylabel(成功率) plt.xticks(rotation45) # 子图3分辨率与生成时间关系 plt.subplot(2, 2, 3) zimage_clean.plot.scatter(xresolution_area, ygeneration_time_seconds, csuccess, cmapviridis, alpha0.7) plt.title(分辨率面积 vs 生成时间) plt.xlabel(分辨率面积像素) plt.ylabel(生成时间秒) # 子图4不同类别提示词的成功率 plt.subplot(2, 2, 4) category_success zimage_clean.groupby(prompt_category)[success].agg([mean, count]) category_success[mean].plot(kindbar, colorlightgreen, alpha0.7) plt.title(不同提示词类别的成功率) plt.xlabel(类别) plt.ylabel(成功率) plt.xticks(rotation45) plt.tight_layout() plt.show() # 打印关键发现 print( 关键发现 ) print(f平均提示词长度: {zimage_clean[prompt_length].mean():.1f} 字符) print(f最佳提示词长度区间: {length_bins.value_counts().idxmax()}) print(f方形分辨率成功率: {zimage_clean[zimage_clean[is_square]][success].mean():.2%}) print(f非方形分辨率成功率: {zimage_clean[~zimage_clean[is_square]][success].mean():.2%})这段代码揭示了几个实用的规律提示词长度在某个范围内时成功率最高方形分辨率可能比非方形更稳定某些主题类别如动物的生成效果可能优于其他类别。这些不是凭空猜测而是基于真实数据的客观结论。4. Matplotlib可视化让数据自己讲故事数据可视化是将分析结果转化为可操作洞见的关键步骤。让我们创建一些真正有用的图表帮助理解Z-Image模型的行为模式。4.1 生成时间性能分析对于需要批量生成图片的工作流了解不同设置下的性能表现至关重要# 创建性能分析图表 fig, axes plt.subplots(2, 2, figsize(15, 12)) fig.suptitle(Z-Image-Turbo性能分析, fontsize16, fontweightbold) # 1. 不同分辨率下的平均生成时间 resolutions zimage_clean[size].unique() time_by_resolution zimage_clean.groupby(size)[generation_time_seconds].agg([mean, std]).sort_values(mean) time_by_resolution[mean].plot(kindbarh, axaxes[0,0], colorsteelblue, alpha0.8) axes[0,0].set_title(不同分辨率的平均生成时间) axes[0,0].set_xlabel(时间秒) axes[0,0].set_ylabel(分辨率) # 在条形图上添加标准差 for i, (index, row) in enumerate(time_by_resolution.iterrows()): axes[0,0].errorbar(row[mean], i, xerrrow[std], fmtnone, ecolorred, capsize5) # 2. 提示词增强功能对性能的影响 enhance_impact zimage_clean.groupby(prompt_extend_enabled)[generation_time_seconds].agg([mean, count]) enhance_impact[mean].plot(kindbar, axaxes[0,1], color[lightblue, darkblue], alpha0.7) axes[0,1].set_title(提示词增强功能对生成时间的影响) axes[0,1].set_ylabel(平均时间秒) axes[0,1].set_xlabel(提示词增强启用状态) axes[0,1].set_xticklabels([关闭, 启用]) # 在柱状图上添加计数标签 for i, v in enumerate(enhance_impact[count]): axes[0,1].text(i, enhance_impact[mean].iloc[i] 0.1, fn{v}, hacenter, vabottom) # 3. 成功率热力图分辨率宽高比 vs 提示词长度 # 创建宽高比分组 zimage_clean[aspect_group] pd.cut(zimage_clean[aspect_ratio], bins[0, 0.5, 0.8, 1.0, 1.2, 1.5, 2.0, 5.0], labels[0.5, 0.5-0.8, 0.8-1.0, 1.0-1.2, 1.2-1.5, 1.5-2.0, 2.0]) # 创建提示词长度分组 zimage_clean[length_group] pd.cut(zimage_clean[prompt_length], bins[0, 30, 60, 90, 120, 150, 200], labels[30, 30-60, 60-90, 90-120, 120-150, 150]) # 计算成功率热力图数据 heatmap_data zimage_clean.groupby([aspect_group, length_group])[success].mean().unstack() sns.heatmap(heatmap_data, annotTrue, fmt.2%, cmapRdYlGn, axaxes[1,0], cbar_kws{label: 成功率}) axes[1,0].set_title(宽高比 × 提示词长度 成功率热力图) axes[1,0].set_xlabel(提示词长度分组) axes[1,0].set_ylabel(宽高比分组) # 4. 时间-成功率散点图 scatter_data zimage_clean[zimage_clean[success]] axes[1,1].scatter(scatter_data[generation_time_seconds], scatter_data[prompt_length], cscatter_data[resolution_area]/1e6, cmapviridis, alpha0.6, s50) axes[1,1].set_xlabel(生成时间秒) axes[1,1].set_ylabel(提示词长度字符) axes[1,1].set_title(成功生成案例时间 vs 提示词长度\n颜色表示分辨率面积单位百万像素) plt.colorbar(axes[1,1].collections[0], axaxes[1,1], label分辨率面积百万像素) plt.tight_layout() plt.show()这个综合图表提供了多维度的性能视图哪个分辨率最快提示词增强功能值得开启吗什么宽高比和提示词长度的组合最可靠这些答案可以直接指导你的工作流程优化。4.2 效果质量趋势分析虽然我们无法直接量化图片质量那需要复杂的图像质量评估模型但可以通过间接指标来评估# 创建质量趋势分析 fig, ((ax1, ax2), (ax3, ax4)) plt.subplots(2, 2, figsize(15, 12)) fig.suptitle(Z-Image-Turbo效果质量趋势分析, fontsize16, fontweightbold) # 1. 不同类别提示词的平均生成时间作为质量代理 category_time zimage_clean.groupby(prompt_category)[generation_time_seconds].mean().sort_values() category_time.plot(kindbarh, axax1, colormediumseagreen, alpha0.8) ax1.set_title(不同类别提示词的平均生成时间\n时间越长可能表示处理更复杂) ax1.set_xlabel(平均时间秒) # 2. 提示词长度与生成时间的关系散点图 ax2.scatter(zimage_clean[prompt_length], zimage_clean[generation_time_seconds], czimage_clean[success].map({True: green, False: red}), alpha0.6, s50) ax2.set_xlabel(提示词长度字符) ax2.set_ylabel(生成时间秒) ax2.set_title(提示词长度 vs 生成时间\n绿色成功红色失败) ax2.grid(True, alpha0.3) # 3. 分辨率面积与成功率的关系 area_bins pd.cut(zimage_clean[resolution_area], bins[0, 1e6, 1.5e6, 2e6, 3e6, 4e6], labels[1M, 1-1.5M, 1.5-2M, 2-3M, 3M]) success_by_area zimage_clean.groupby(area_bins)[success].mean() success_by_area.plot(kindbar, axax3, colorgold, alpha0.7) ax3.set_title(分辨率面积分组 vs 成功率) ax3.set_xlabel(分辨率面积分组) ax3.set_ylabel(成功率) ax3.tick_params(axisx, rotation0) # 4. 时间效率分析生成时间/分辨率面积每百万像素耗时 zimage_clean[efficiency] zimage_clean[generation_time_seconds] / (zimage_clean[resolution_area] / 1e6) efficiency_by_category zimage_clean.groupby(prompt_category)[efficiency].mean().sort_values() efficiency_by_category.plot(kindbarh, axax4, colorslateblue, alpha0.8) ax4.set_title(不同类别提示词的时间效率\n每百万像素耗时秒) ax4.set_xlabel(每百万像素耗时秒) plt.tight_layout() plt.show() # 输出实用建议 print( 基于数据分析的实用建议 ) print(f• 对于快速测试优先使用 {time_by_resolution.index[0]} 分辨率) print(f• 如果追求质量且时间充裕考虑启用提示词增强功能但需接受 {enhance_impact[mean].iloc[1]/enhance_impact[mean].iloc[0]:.1f}x 的时间成本) print(f• 最稳定的宽高比范围{heatmap_data.mean().idxmax()} 分组) print(f• 高效的提示词长度{zimage_clean[zimage_clean[efficiency]zimage_clean[efficiency].min()][prompt_length].iloc[0]} 字符左右)这些图表不仅美观更重要的是它们揭示了模型的内在行为模式。例如如果发现某种提示词类别总是需要更长的生成时间这可能意味着模型在处理这类概念时需要更多的计算资源从而暗示了潜在的质量优势。5. 实际应用构建你的个性化Z-Image分析工作流理论分析最终要服务于实际工作。让我们构建一个完整的、可重复使用的分析工作流你可以直接在自己的项目中应用。class ZImageAnalyzer: Z-Image模型效果分析器 def __init__(self, data_pathNone): self.data pd.DataFrame() if data_path is None else pd.read_csv(data_path) self.results {} def add_record(self, **kwargs): 添加单次生成记录 record { timestamp: datetime.now().isoformat(), prompt: kwargs.get(prompt, ), prompt_length: len(kwargs.get(prompt, )), size: kwargs.get(size, 1024*1024), image_count: kwargs.get(n, 1), prompt_extend_enabled: kwargs.get(prompt_extend, False), generation_time_seconds: kwargs.get(generation_time, 0), success: kwargs.get(success, True), image_url: kwargs.get(image_url, None), error_message: kwargs.get(error_message, None), resolution_width: int(kwargs.get(size, 1024*1024).split(*)[0]), resolution_height: int(kwargs.get(size, 1024*1024).split(*)[1]), aspect_ratio: round(int(kwargs.get(size, 1024*1024).split(*)[0]) / int(kwargs.get(size, 1024*1024).split(*)[1]), 2) } self.data pd.concat([self.data, pd.DataFrame([record])], ignore_indexTrue) def load_from_csv(self, csv_path): 从CSV文件加载数据 self.data pd.read_csv(csv_path) def save_to_csv(self, csv_path): 保存数据到CSV文件 self.data.to_csv(csv_path, indexFalse) def generate_summary_report(self): 生成综合分析报告 if self.data.empty: print(没有数据可供分析) return # 基础统计 total_generations len(self.data) success_rate self.data[success].mean() avg_time self.data[generation_time_seconds].mean() # 提示词分析 avg_prompt_length self.data[prompt_length].mean() optimal_length self.data.groupby(pd.cut(self.data[prompt_length], bins10))[success].mean().idxmax() # 分辨率分析 best_resolution self.data.groupby(size)[success].mean().idxmax() best_aspect_ratio self.data.groupby(aspect_ratio)[success].mean().idxmax() # 性能分析 fastest_resolution self.data.groupby(size)[generation_time_seconds].mean().idxmin() self.results[summary] { total_generations: total_generations, success_rate: success_rate, avg_generation_time: avg_time, avg_prompt_length: avg_prompt_length, optimal_prompt_length_range: optimal_length, best_resolution: best_resolution, best_aspect_ratio: best_aspect_ratio, fastest_resolution: fastest_resolution } return self.results[summary] def create_visualization_dashboard(self, save_pathNone): 创建可视化仪表板 if self.data.empty: print(没有数据可供可视化) return fig, axes plt.subplots(2, 2, figsize(16, 12)) fig.suptitle(Z-Image-Turbo分析仪表板, fontsize18, fontweightbold) # 1. 成功率随时间变化 self.data[date] pd.to_datetime(self.data[timestamp]).dt.date daily_success self.data.groupby(date)[success].mean() daily_success.plot(axaxes[0,0], markero, linewidth2, colordarkgreen) axes[0,0].set_title(每日生成成功率趋势) axes[0,0].set_ylabel(成功率) axes[0,0].grid(True, alpha0.3) # 2. 提示词长度分布 self.data[prompt_length].hist(bins20, axaxes[0,1], alpha0.7, colorsteelblue, edgecolorblack) axes[0,1].set_title(提示词长度分布) axes[0,1].set_xlabel(字符数) axes[0,1].set_ylabel(频次) # 3. 分辨率成功率热力图 resolution_success self.data.groupby([resolution_width, resolution_height])[success].mean().unstack() sns.heatmap(resolution_success, annotTrue, fmt.2%, cmapRdYlBu_r, axaxes[1,0], cbar_kws{label: 成功率}) axes[1,0].set_title(分辨率成功率热力图) # 4. 生成时间箱线图 self.data.boxplot(columngeneration_time_seconds, byprompt_extend_enabled, axaxes[1,1], patch_artistTrue) axes[1,1].set_title(提示词增强功能对生成时间的影响) axes[1,1].set_ylabel(生成时间秒) axes[1,1].set_xlabel(提示词增强状态) plt.tight_layout() if save_path: plt.savefig(save_path, dpi300, bbox_inchestight) print(f仪表板已保存至: {save_path}) plt.show() def get_optimization_recommendations(self): 获取优化建议 if not self.results.get(summary): self.generate_summary_report() summary self.results[summary] recommendations [] # 基于成功率的建议 if summary[success_rate] 0.85: recommendations.append(成功率低于85%建议检查提示词质量和内容审核限制) # 基于提示词长度的建议 if summary[avg_prompt_length] 120: recommendations.append(f平均提示词长度({summary[avg_prompt_length]:.0f})过长尝试精简到{summary[optimal_prompt_length_range]}区间) # 基于分辨率的建议 if summary[best_resolution] ! summary[fastest_resolution]: recommendations.append(f最佳成功率分辨率({summary[best_resolution]})与最快分辨率({summary[fastest_resolution]})不同根据需求权衡) # 基于时间的建议 if summary[avg_generation_time] 10: recommendations.append(f平均生成时间({summary[avg_generation_time]:.1f}s)较长考虑降低分辨率或禁用提示词增强) return recommendations # 使用示例 analyzer ZImageAnalyzer() # 添加一些模拟数据 for i in range(50): prompt_len np.random.randint(40, 150) prompt A .join([cat] * (prompt_len // 4)) if i % 3 0 else \ Landscape with mountains and lake if i % 3 1 else \ Modern architecture building analyzer.add_record( promptprompt, sizenp.random.choice([1024*1024, 1104*1472, 1280*1280, 1472*1104]), n1, prompt_extendnp.random.choice([True, False]), generation_timenp.random.normal(7, 2) (prompt_len/100)*2, successnp.random.random() 0.1 ) # 生成报告 report analyzer.generate_summary_report() print( Z-Image分析报告 ) for key, value in report.items(): if isinstance(value, float): print(f{key}: {value:.2%} if rate in key else f{key}: {value:.2f}) else: print(f{key}: {value}) # 获取优化建议 print(\n 优化建议 ) for rec in analyzer.get_optimization_recommendations(): print(f• {rec}) # 创建可视化仪表板 analyzer.create_visualization_dashboard()这个ZImageAnalyzer类封装了整个分析流程从数据收集到报告生成再到可视化。你可以将其集成到自己的Z-Image工作流中在每次生成图片时自动记录数据定期运行分析以持续优化你的创作流程。6. 进阶技巧将分析融入日常创作分析不应该是一次性的活动而应该成为创作流程的一部分。以下是几个将数据分析融入日常工作的实用技巧6.1 自动化实验框架为常见的创作任务建立标准化的实验模板def run_prompt_experiment(base_prompt, variations, resolutions, n_trials3): 运行提示词变体实验 base_prompt: 基础提示词 variations: 提示词变体列表如[写实, 插画, 油画] resolutions: 测试的分辨率列表 n_trials: 每个组合的测试次数 results [] for variation in variations: full_prompt f{base_prompt}, {variation} style for resolution in resolutions: for trial in range(n_trials): try: # 这里调用Z-Image API start_time time.time() # response zimage_api_call(full_prompt, resolution) end_time time.time() # 模拟API响应 success np.random.random() 0.05 # 95%成功率 generation_time end_time - start_time np.random.normal(0, 0.5) results.append({ base_prompt: base_prompt, variation: variation, resolution: resolution, trial: trial 1, prompt: full_prompt, success: success, generation_time: round(generation_time, 2), prompt_length: len(full_prompt) }) except Exception as e: results.append({ base_prompt: base_prompt, variation: variation, resolution: resolution, trial: trial 1, prompt: full_prompt, success: False, generation_time: 0, prompt_length: len(full_prompt), error: str(e) }) return pd.DataFrame(results) # 运行一个实验 experiment_results run_prompt_experiment( base_prompt一只橘猫坐在窗台上, variations[写实, 水彩, 赛博朋克, 极简主义], resolutions[1024*1024, 1104*1472, 1280*1280], n_trials2 ) print(实验完成共生成, len(experiment_results), 条记录) print(\n实验结果摘要:) print(experiment_results.groupby([variation, resolution])[success].agg([mean, count]))6.2 创建个人提示词库基于分析结果构建最适合你风格的提示词模板class PromptLibrary: 个人提示词库管理器 def __init__(self): self.library {} def add_template(self, category, name, template, tagsNone, rating0): 添加提示词模板 if category not in self.library: self.library[category] {} self.library[category][name] { template: template, tags: tags or [], rating: rating, usage_count: 0, last_used: None } def get_best_templates(self, category, min_rating4, limit5): 获取指定类别下评分最高的模板 if category not in self.library: return [] templates [(name, data) for name, data in self.library[category].items() if data[rating] min_rating] templates.sort(keylambda x: x[1][rating], reverseTrue) return templates[:limit] def rate_template(self, category, name, rating): 给模板评分 if category in self.library and name in self.library[category]: self.library[category][name][rating] rating def get_statistics(self): 获取库统计信息 total sum(len(templates) for templates in self.library.values()) return { total_templates: total, categories: list(self.library.keys()), templates_by_category: {cat: len(templates) for cat, templates in self.library.items()} } # 创建个人提示词库 my_library PromptLibrary() # 添加一些模板 my_library.add_template( animals, cat_portrait, 一只{adjective}的{color}猫{pose}{background}{style}风格高清细节, [cat, portrait, animals], rating5 ) my_library.add_template( landscapes, mountain_lake, {time_of_day}的{mountain_type}山脉{lake_description}{weather}{style}风格, [landscape, mountains, lake], rating4 ) # 获取最佳模板 best_animal_templates my_library.get_best_templates(animals, min_rating4) print(最佳动物类模板:) for name, data in best_animal_templates: print(f • {name}: {data[template]}) print(\n库统计:, my_library.get_statistics())6.3 持续学习与迭代将分析结果反馈到创作过程中形成持续改进的闭环def create_improvement_plan(analyzer, library): 基于分析结果创建改进计划 report analyzer.generate_summary_report() plan { focus_areas: [], immediate_actions: [], long_term_goals: [] } # 立即行动 if report[success_rate] 0.8: plan[immediate_actions].append(检查最近失败的提示词识别常见问题模式) plan[immediate_actions].append(尝试简化提示词聚焦核心元素) if report[avg_generation_time] 8: plan[immediate_actions].append(测试更低分辨率设置如1024*1024) plan[immediate_actions].append(暂时禁用提示词增强功能进行对比测试) # 重点关注领域 if report[avg_prompt_length] 100: plan[focus_areas].append(提示词精炼技巧学习如何用更少的词表达更多含义) if report[best_resolution] ! 1024*1024: plan[focus_areas].append(f研究{report[best_resolution]}分辨率的最佳实践) # 长期目标 plan[long_term_goals].append(建立包含100经过验证的提示词模板的个人库) plan[long_term_goals].append(实现95%以上的生成成功率) plan[long_term_goals].append(将平均生成时间控制在5秒以内) return plan # 创建改进计划 improvement_plan create_improvement_plan(analyzer, my_library) print( Z-Image创作改进计划 \n) print(重点关注领域:) for area in improvement_plan[focus_areas]: print(f• {area}) print(\n立即行动:) for action in improvement_plan[immediate_actions]: print(f• {action}) print(\n长期目标:) for goal in improvement_plan[long_term_goals]: print(f• {goal})获取更多AI镜像想探索更多AI镜像和应用场景访问 CSDN星图镜像广场提供丰富的预置镜像覆盖大模型推理、图像生成、视频生成、模型微调等多个领域支持一键部署。