config.yaml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. # 本地大模型配置文件
  2. models:
  3. # VLM模型(用于图片理解和修复)
  4. qwen2_vl:
  5. name: "Qwen2.5-VL-72B-Instruct-AWQ"
  6. api_base: "http://10.192.72.12:9991/v1"
  7. api_key: "${YUSYS_MULTIMODAL_API_KEY}"
  8. model_id: "Qwen2.5-VL-72B-Instruct-AWQ"
  9. type: "vlm"
  10. default_params:
  11. temperature: 0.1
  12. max_tokens: 4096
  13. timeout: 180
  14. llava:
  15. name: "LLaVA-v1.6-34B"
  16. api_base: "http://localhost:11434/v1"
  17. api_key: ""
  18. model_id: "llava:34b"
  19. type: "vlm"
  20. default_params:
  21. temperature: 0.1
  22. max_tokens: 4096
  23. timeout: 180
  24. cogvlm:
  25. name: "CogVLM2-19B"
  26. api_base: "http://localhost:11434/v1"
  27. api_key: ""
  28. model_id: "cogvlm2:19b"
  29. type: "vlm"
  30. default_params:
  31. temperature: 0.1
  32. max_tokens: 4096
  33. timeout: 180
  34. # 图片生成模型
  35. dashscope_wanx:
  36. name: "通义万相-风格重绘"
  37. api_base: "https://dashscope.aliyuncs.com/api/v1/services/aigc/image-generation/generation"
  38. api_key: "${DASHSCOPE_API_KEY}"
  39. model_id: "wanx-style-repaint-v1"
  40. type: "image_generation"
  41. generation_type: "style_repaint" # 风格重绘
  42. default_params:
  43. style_index: 6
  44. timeout: 300
  45. poll_interval: 5
  46. modelscope_qwen:
  47. name: "ModelScope-Qwen文生图"
  48. api_base: "https://api-inference.modelscope.cn/v1/images/generations"
  49. api_key: "${MODELSCOPE_API_KEY}"
  50. model_id: "Qwen/Qwen-Image"
  51. type: "image_generation"
  52. generation_type: "text_to_image" # 文生图
  53. default_params:
  54. timeout: 300
  55. poll_interval: 5
  56. dashscope_flux:
  57. name: "通义万相-FLUX"
  58. api_base: "https://dashscope.aliyuncs.com/api/v1/services/aigc/text2image/image-synthesis"
  59. api_key: "${DASHSCOPE_API_KEY}"
  60. model_id: "flux-schnell"
  61. type: "image_generation"
  62. generation_type: "text_to_image" # 文生图
  63. default_params:
  64. size: "1024*1024"
  65. timeout: 300
  66. poll_interval: 5
  67. # 新增背景生成模型
  68. dashscope_background:
  69. name: "通义万相-背景生成"
  70. api_base: "https://dashscope.aliyuncs.com/api/v1/services/aigc/background-generation/generation/"
  71. api_key: "${DASHSCOPE_API_KEY}"
  72. model_id: "wanx-background-generation-v2"
  73. type: "image_generation"
  74. generation_type: "background_generation" # 背景生成
  75. default_params:
  76. model_version: "v3"
  77. n: 1
  78. timeout: 300
  79. poll_interval: 5
  80. # 提示词模板
  81. prompts:
  82. # 原有的VLM提示词...
  83. photo_analysis:
  84. name: "照片分析"
  85. type: "vlm"
  86. template: |
  87. 请仔细观察这张照片,分析以下内容:
  88. 1. 照片的拍摄环境和背景
  89. 2. 人物的外貌特征和着装
  90. 3. 照片的拍摄时间推测(基于服装、环境等)
  91. 4. 照片的保存状况(是否有破损、褪色等)
  92. 5. 照片的历史价值和意义
  93. 请用中文详细描述,分条列出分析结果。
  94. # 图片生成提示词
  95. photo_style_repaint:
  96. name: "照片风格重绘"
  97. type: "image_generation"
  98. compatible_models: ["dashscope_wanx"]
  99. template: |
  100. 对输入的照片进行风格重绘,保持人物特征和基本构图,应用指定的艺术风格。
  101. 风格选项:0=复古漫画, 1=3D童话, 2=二次元, 3=小清新, 4=未来科技, 5=国画古风, 6=油画质感
  102. text_to_image_simple:
  103. name: "简单文生图"
  104. type: "image_generation"
  105. compatible_models: ["modelscope_qwen", "dashscope_flux"]
  106. template: |
  107. 根据文本描述生成高质量图片。请提供详细的场景描述、人物特征、光线效果和艺术风格要求。
  108. photo_restoration:
  109. name: "AI照片修复"
  110. type: "image_generation"
  111. compatible_models: ["dashscope_wanx"]
  112. template: |
  113. 修复老旧照片:去除折痕、划痕、污渍,提升清晰度,保持原有人物特征。
  114. {prompt}
  115. # 新增背景生成提示词
  116. background_classroom:
  117. name: "教室背景生成"
  118. type: "image_generation"
  119. compatible_models: ["dashscope_background"]
  120. template: |
  121. 1980年代中国大学教室场景:后方是深绿色黑板,略有粉笔痕迹,前方是深褐色木质课桌,教室光线明亮柔和,营造温馨的学习氛围
  122. background_landscape:
  123. name: "风景背景生成"
  124. type: "image_generation"
  125. compatible_models: ["dashscope_background"]
  126. template: |
  127. {prompt}
  128. background_studio:
  129. name: "影棚背景生成"
  130. type: "image_generation"
  131. compatible_models: ["dashscope_background"]
  132. template: |
  133. 专业摄影影棚背景,柔和灯光,纯色或渐变背景,适合人像摄影
  134. # 预设风格配置
  135. style_presets:
  136. dashscope_styles:
  137. - {index: 0, name: "复古漫画", description: "复古漫画风格,线条清晰,色彩饱和"}
  138. - {index: 1, name: "3D童话", description: "3D童话风格,梦幻可爱,立体感强"}
  139. - {index: 2, name: "二次元", description: "二次元动漫风格,日式插画感"}
  140. - {index: 3, name: "小清新", description: "小清新风格,色彩柔和,清新自然"}
  141. - {index: 4, name: "未来科技", description: "未来科技风格,金属质感,科幻氛围"}
  142. - {index: 5, name: "国画古风", description: "中国风水墨画风格,古典雅致"}
  143. - {index: 6, name: "油画质感", description: "油画质感,色彩丰富,艺术感强"}
  144. # 默认配置
  145. default:
  146. vlm_model: "qwen2_vl"
  147. image_gen_model: "dashscope_wanx"
  148. prompt: "photo_analysis"
  149. style_index: -1 # -1表示使用使用自定义风格, 0-6表示使用对应风格