auto-coder 0.1.193__tar.gz → 0.1.195__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of auto-coder might be problematic. Click here for more details.
- {auto_coder-0.1.193 → auto_coder-0.1.195}/PKG-INFO +1 -1
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/auto_coder.egg-info/PKG-INFO +1 -1
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/agent/designer.py +224 -32
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/auto_coder.py +108 -61
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/auto_coder_server.py +2 -2
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/chat_auto_coder.py +5 -1
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/command_args.py +13 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/__init__.py +3 -1
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/code_auto_merge_editblock.py +1 -1
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/command_templates.py +2 -2
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/index/index.py +237 -66
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/lang.py +7 -3
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/utils/queue_communicate.py +30 -7
- auto_coder-0.1.195/src/autocoder/version.py +1 -0
- auto_coder-0.1.193/src/autocoder/version.py +0 -1
- {auto_coder-0.1.193 → auto_coder-0.1.195}/LICENSE +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/README.md +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/setup.cfg +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/setup.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/auto_coder.egg-info/SOURCES.txt +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/auto_coder.egg-info/dependency_links.txt +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/auto_coder.egg-info/entry_points.txt +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/auto_coder.egg-info/requires.txt +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/auto_coder.egg-info/top_level.txt +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/agent/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/agent/auto_tool.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/agent/coder.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/agent/planner.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/agent/project_reader.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/auto_coder_lang.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/auto_coder_rag.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/chat/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/chat_auto_coder_lang.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/JupyterClient.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/ShellClient.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/anything2images.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/audio.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/cleaner.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/code_auto_execute.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/code_auto_generate.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/code_auto_generate_diff.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/code_auto_generate_editblock.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/code_auto_generate_strict_diff.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/code_auto_merge.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/code_auto_merge_diff.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/code_auto_merge_strict_diff.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/command_completer.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/command_generator.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/const.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/git_utils.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/image_to_page.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/interpreter.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/llm_rerank.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/screenshots.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/search.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/search_replace.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/text.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/common/types.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/db/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/db/store.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/dispacher/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/dispacher/actions/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/dispacher/actions/action.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/dispacher/actions/copilot.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/dispacher/actions/plugins/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/dispacher/actions/plugins/action_regex_project.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/dispacher/actions/plugins/action_translate.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/index/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/index/for_command.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/index/symbols_utils.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/pyproject/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/api_server.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/cache/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/cache/base_cache.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/cache/byzer_storage_cache.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/cache/file_monitor_cache.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/cache/simple_cache.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/doc_filter.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/document_retriever.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/llm_wrapper.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/loaders/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/loaders/docx_loader.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/loaders/excel_loader.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/loaders/pdf_loader.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/loaders/ppt_loader.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/long_context_rag.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/rag_config.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/rag_entry.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/raw_rag.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/relevant_utils.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/simple_directory_reader.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/simple_rag.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/stream_event/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/stream_event/event_writer.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/stream_event/types.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/token_checker.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/token_counter.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/token_limiter.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/types.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/utils.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/rag/variable_holder.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/regexproject/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/suffixproject/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/tsproject/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/utils/__init__.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/utils/conversation_store.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/utils/llm_client_interceptors.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/utils/log_capture.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/utils/multi_turn.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/utils/print_table.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/utils/request_event_queue.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/utils/request_queue.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/utils/rest.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/src/autocoder/utils/tests.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/tests/test_action_regex_project.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/tests/test_chat_auto_coder.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/tests/test_code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/tests/test_command_completer.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/tests/test_planner.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/tests/test_queue_communicate.py +0 -0
- {auto_coder-0.1.193 → auto_coder-0.1.195}/tests/test_symbols_utils.py +0 -0
|
@@ -6,39 +6,229 @@ import json
|
|
|
6
6
|
import base64
|
|
7
7
|
import platform
|
|
8
8
|
import matplotlib.font_manager as fm
|
|
9
|
+
from pydantic import BaseModel
|
|
10
|
+
class LogoDesign(BaseModel):
|
|
11
|
+
selectedStyle: str
|
|
12
|
+
companyName: str
|
|
13
|
+
selectedBackgroundColor: str
|
|
14
|
+
selectedPrimaryColor: str
|
|
15
|
+
additionalInfo: str
|
|
16
|
+
|
|
17
|
+
class LogoDesigner:
|
|
18
|
+
def __init__(self, args: AutoCoderArgs, llm: byzerllm.ByzerLLM):
|
|
19
|
+
self.llm = llm
|
|
20
|
+
if not args.sd_model:
|
|
21
|
+
raise ValueError("sd_model is not set")
|
|
22
|
+
self.sd_model_llm = self.llm.get_sub_client("sd_model")
|
|
23
|
+
self.args = args
|
|
24
|
+
|
|
25
|
+
@byzerllm.prompt()
|
|
26
|
+
def extract_logo_info(self, query: str) -> str:
|
|
27
|
+
"""
|
|
28
|
+
根据用户的需求,抽取相关信息,生成一个LogoDesign对象。生成的信息必须使用英文,对于没有提及的信息,请
|
|
29
|
+
根据你对用户需求的理解,给出合理的默认值。
|
|
30
|
+
|
|
31
|
+
用户需求:
|
|
32
|
+
我想创建一个闪亮前卫的科技公司logo,我的公司名叫做"ByteWave",喜欢深蓝色和白色的搭配。我们是一家专注于人工智能的公司。
|
|
33
|
+
|
|
34
|
+
LogoDesign对象示例:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"selectedStyle": "Tech",
|
|
39
|
+
"companyName": "ByteWave",
|
|
40
|
+
"selectedBackgroundColor": "white",
|
|
41
|
+
"selectedPrimaryColor": "dark blue",
|
|
42
|
+
"additionalInfo": "AI technology focused company"
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
现在请根据如下用户需求生成一个LogoDesign Json对象:
|
|
47
|
+
|
|
48
|
+
{{ query }}
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
@byzerllm.prompt()
|
|
52
|
+
def enhance_logo_generate(
|
|
53
|
+
self,
|
|
54
|
+
selectedStyle:str,
|
|
55
|
+
companyName,
|
|
56
|
+
selectedBackgroundColor,
|
|
57
|
+
selectedPrimaryColor,
|
|
58
|
+
additionalInfo,
|
|
59
|
+
) -> str:
|
|
60
|
+
"""
|
|
61
|
+
A single logo, high-quality, award-winning professional design, made for both digital and print media, only contains a few vector shapes, {{ selectedStyle }}
|
|
62
|
+
|
|
63
|
+
Primary color is {{ selectedPrimaryColor }} and background color is {{ selectedBackgroundColor }}. The company name is {{ companyName }}, make sure to include the company name in the logo. {{ "Additional info: " + additionalInfo if additionalInfo else "" }}
|
|
64
|
+
"""
|
|
65
|
+
style_lookup = {
|
|
66
|
+
"Flashy": "Flashy, attention grabbing, bold, futuristic, and eye-catching. Use vibrant neon colors with metallic, shiny, and glossy accents.",
|
|
67
|
+
"Tech": "highly detailed, sharp focus, cinematic, photorealistic, Minimalist, clean, sleek, neutral color pallete with subtle accents, clean lines, shadows, and flat.",
|
|
68
|
+
"Modern": "modern, forward-thinking, flat design, geometric shapes, clean lines, natural colors with subtle accents, use strategic negative space to create visual interest.",
|
|
69
|
+
"Playful": "playful, lighthearted, bright bold colors, rounded shapes, lively.",
|
|
70
|
+
"Abstract": "abstract, artistic, creative, unique shapes, patterns, and textures to create a visually interesting and wild logo.",
|
|
71
|
+
"Minimal": "minimal, simple, timeless, versatile, single color logo, use negative space, flat design with minimal details, Light, soft, and subtle.",
|
|
72
|
+
}
|
|
73
|
+
return {"selectedStyle": style_lookup[selectedStyle],"additionalInfo":self.enhance_query.prompt(additionalInfo)}
|
|
74
|
+
|
|
75
|
+
@byzerllm.prompt()
|
|
76
|
+
def enhance_query(self, query: str) -> str:
|
|
77
|
+
"""
|
|
78
|
+
你非常擅长使用文生图模型,特别能把用户简单的需求具象化。你的目标是转化用户的需求,使得转化后的
|
|
79
|
+
文本更加适合问生图模型生成符合用户需求的图片。
|
|
80
|
+
|
|
81
|
+
特别注意:
|
|
82
|
+
1. 无论用户使用的是什么语言,你的改进后的表达都需要是英文。
|
|
83
|
+
|
|
84
|
+
用户需求:
|
|
85
|
+
我想设计一个偏卡通类的游戏,AGI PoLang 的游戏应用界面。
|
|
86
|
+
|
|
87
|
+
改进后的表达:
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
Design a vibrant game app interface titled 'AGI PoLang' with a soothing blue background featuring a lush landscape of towering trees and dense bushes framing the sides.
|
|
91
|
+
At the heart of the screen, elegantly display the game's name in a golden,
|
|
92
|
+
playful font that captivates attention.
|
|
93
|
+
Beneath this, strategically place two interactive buttons labeled 'Play Game' and 'Quit Game',
|
|
94
|
+
ensuring they are both visually appealing and user-friendly.
|
|
95
|
+
Center stage, introduce an engaging scene where an orange wolf stands majestically on a verdant field,
|
|
96
|
+
set against a serene blue sky dotted with fluffy white clouds.
|
|
97
|
+
The entire design should radiate a fun and playful atmosphere,
|
|
98
|
+
encapsulating the spirit of adventure and joy that 'AGI PoLang' promises to deliver.
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
用户需求:
|
|
102
|
+
帮我设计一个财务报告网页页面,要时尚美观。
|
|
103
|
+
|
|
104
|
+
改进后的表达:
|
|
105
|
+
```text
|
|
106
|
+
Create a web UI page. Design a sleek and intuitive financial reports web page,
|
|
107
|
+
featuring a clean menu layout, seamless navigation,
|
|
108
|
+
and a comprehensive display of reports.
|
|
109
|
+
The website should embody a clear and organized typography, enhancing readability and user experience.
|
|
110
|
+
Incorporate dynamic lighting effects to highlight key financial data, simulating the precision and clarity of a well-managed budget.
|
|
111
|
+
The overall design should reflect the stability and growth of financial health,
|
|
112
|
+
serving as a visual metaphor for the solid foundation and strategic planning required in personal and corporate finance.
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
用户需求:
|
|
116
|
+
|
|
117
|
+
生成一个在自然环境中展示的防晒产品的逼真模型。产品应置于画面中心,标签清晰可见。
|
|
118
|
+
将产品置于一种原始风景的背景之前,该风景包括山脉、湖泊和生动的绿色植被。
|
|
119
|
+
包括花朵、石头,可能还有一两只鹿在背景中,以增强户外、新鲜的感觉。
|
|
120
|
+
使用明亮的自然光照强调产品,并确保构图平衡,色彩搭配和谐,与品牌设计相得益彰。
|
|
121
|
+
|
|
122
|
+
改进后的表达:
|
|
123
|
+
```text
|
|
124
|
+
Generate a photorealistic mockup of a sunscreen product displayed in a serene natural setting.
|
|
125
|
+
The product should be centered in the frame, with its label clearly visible.
|
|
126
|
+
Position the product against a backdrop of a pristine landscape featuring a mountain, a lake, and vibrant greenery.
|
|
127
|
+
Include natural elements like flowers, rocks, and possibly a deer or two in the background to enhance the outdoor, fresh feel.
|
|
128
|
+
Use bright, natural lighting to highlight the product, and ensure the composition is balanced with a harmonious color palette
|
|
129
|
+
that complements the brand's design.
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
用户需求:
|
|
133
|
+
一个扎着双马尾、手持棒球棒的女人,走在走廊上。灯光转变为危险的红色,营造出紧张的黑色电影风格氛围。
|
|
134
|
+
|
|
135
|
+
改进后的表达:
|
|
136
|
+
```text
|
|
137
|
+
A slow dolly-in camera follows a woman with pigtails holding a baseball bat as she walks down a dimly lit hallway.
|
|
138
|
+
The lighting shifts to a menacing red, creating a tense, noir-style atmosphere with echoing footsteps adding suspense.
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
现在让我们开始一个新的任务。
|
|
142
|
+
|
|
143
|
+
用户需求:
|
|
144
|
+
{{ query }}
|
|
145
|
+
|
|
146
|
+
改进后的表达(改进后的表达请用 ```text ```进行包裹):
|
|
147
|
+
"""
|
|
148
|
+
|
|
149
|
+
def run(self, query: str):
|
|
150
|
+
logo_design = self.extract_logo_info.with_llm(self.llm).with_return_type(LogoDesign).run(query)
|
|
151
|
+
|
|
152
|
+
enhanced_query_str = (
|
|
153
|
+
self.enhance_logo_generate.with_llm(self.llm)
|
|
154
|
+
.with_extractor(lambda x: code_utils.extract_code(x)[0][1])
|
|
155
|
+
.run(selectedStyle = logo_design.selectedStyle,
|
|
156
|
+
companyName = logo_design.companyName,
|
|
157
|
+
selectedBackgroundColor = logo_design.selectedBackgroundColor,
|
|
158
|
+
selectedPrimaryColor = logo_design.selectedPrimaryColor,
|
|
159
|
+
additionalInfo = logo_design.additionalInfo)
|
|
160
|
+
)
|
|
161
|
+
response = self.sd_model_llm.chat_oai(
|
|
162
|
+
conversations=[
|
|
163
|
+
{
|
|
164
|
+
"role": "user",
|
|
165
|
+
"content": json.dumps(
|
|
166
|
+
{"input": enhanced_query_str, "size": "1024x1024"},
|
|
167
|
+
ensure_ascii=False,
|
|
168
|
+
),
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
)
|
|
9
172
|
|
|
173
|
+
image_data = base64.b64decode(response[0].output)
|
|
174
|
+
with open("output.jpg", "wb") as f:
|
|
175
|
+
f.write(image_data)
|
|
10
176
|
|
|
11
177
|
class SDDesigner:
|
|
12
178
|
def __init__(self, args: AutoCoderArgs, llm: byzerllm.ByzerLLM):
|
|
13
|
-
self.llm = llm
|
|
179
|
+
self.llm = llm
|
|
14
180
|
if not args.sd_model:
|
|
15
181
|
raise ValueError("sd_model is not set")
|
|
16
182
|
self.sd_model_llm = self.llm.get_sub_client("sd_model")
|
|
17
183
|
self.args = args
|
|
18
184
|
|
|
19
185
|
@byzerllm.prompt()
|
|
20
|
-
def
|
|
21
|
-
|
|
186
|
+
def enhance_logo_generate(
|
|
187
|
+
self,
|
|
188
|
+
selectedStyle:str,
|
|
189
|
+
companyName,
|
|
190
|
+
selectedBackgroundColor,
|
|
191
|
+
selectedPrimaryColor,
|
|
192
|
+
additionalInfo,
|
|
193
|
+
) -> str:
|
|
194
|
+
"""
|
|
195
|
+
A single logo, high-quality, award-winning professional design, made for both digital and print media, only contains a few vector shapes, {{ selectedStyle }}
|
|
196
|
+
|
|
197
|
+
Primary color is {{ selectedPrimaryColor }} and background color is {{ selectedBackgroundColor }}. The company name is {{ companyName }}, make sure to include the company name in the logo. {{ "Additional info: " + additionalInfo if additionalInfo else "" }}
|
|
198
|
+
"""
|
|
199
|
+
style_lookup = {
|
|
200
|
+
"Flashy": "Flashy, attention grabbing, bold, futuristic, and eye-catching. Use vibrant neon colors with metallic, shiny, and glossy accents.",
|
|
201
|
+
"Tech": "highly detailed, sharp focus, cinematic, photorealistic, Minimalist, clean, sleek, neutral color pallete with subtle accents, clean lines, shadows, and flat.",
|
|
202
|
+
"Modern": "modern, forward-thinking, flat design, geometric shapes, clean lines, natural colors with subtle accents, use strategic negative space to create visual interest.",
|
|
203
|
+
"Playful": "playful, lighthearted, bright bold colors, rounded shapes, lively.",
|
|
204
|
+
"Abstract": "abstract, artistic, creative, unique shapes, patterns, and textures to create a visually interesting and wild logo.",
|
|
205
|
+
"Minimal": "minimal, simple, timeless, versatile, single color logo, use negative space, flat design with minimal details, Light, soft, and subtle.",
|
|
206
|
+
}
|
|
207
|
+
return {"selectedStyle": style_lookup[selectedStyle],"additionalInfo":self.enhance_query.prompt(additionalInfo)}
|
|
208
|
+
|
|
209
|
+
@byzerllm.prompt()
|
|
210
|
+
def enhance_query(self, query: str) -> str:
|
|
211
|
+
"""
|
|
22
212
|
你非常擅长使用文生图模型,特别能把用户简单的需求具象化。你的目标是转化用户的需求,使得转化后的
|
|
23
213
|
文本更加适合问生图模型生成符合用户需求的图片。
|
|
24
214
|
|
|
25
215
|
特别注意:
|
|
26
216
|
1. 无论用户使用的是什么语言,你的改进后的表达都需要是英文。
|
|
27
|
-
|
|
217
|
+
|
|
28
218
|
用户需求:
|
|
29
219
|
我想设计一个偏卡通类的游戏,AGI PoLang 的游戏应用界面。
|
|
30
|
-
|
|
220
|
+
|
|
31
221
|
改进后的表达:
|
|
32
222
|
|
|
33
223
|
```text
|
|
34
|
-
Design a vibrant game app interface titled 'AGI PoLang' with a soothing blue background featuring a lush landscape of towering trees and dense bushes framing the sides.
|
|
35
|
-
At the heart of the screen, elegantly display the game's name in a golden,
|
|
36
|
-
playful font that captivates attention.
|
|
37
|
-
Beneath this, strategically place two interactive buttons labeled 'Play Game' and 'Quit Game',
|
|
38
|
-
ensuring they are both visually appealing and user-friendly.
|
|
39
|
-
Center stage, introduce an engaging scene where an orange wolf stands majestically on a verdant field,
|
|
40
|
-
set against a serene blue sky dotted with fluffy white clouds.
|
|
41
|
-
The entire design should radiate a fun and playful atmosphere,
|
|
224
|
+
Design a vibrant game app interface titled 'AGI PoLang' with a soothing blue background featuring a lush landscape of towering trees and dense bushes framing the sides.
|
|
225
|
+
At the heart of the screen, elegantly display the game's name in a golden,
|
|
226
|
+
playful font that captivates attention.
|
|
227
|
+
Beneath this, strategically place two interactive buttons labeled 'Play Game' and 'Quit Game',
|
|
228
|
+
ensuring they are both visually appealing and user-friendly.
|
|
229
|
+
Center stage, introduce an engaging scene where an orange wolf stands majestically on a verdant field,
|
|
230
|
+
set against a serene blue sky dotted with fluffy white clouds.
|
|
231
|
+
The entire design should radiate a fun and playful atmosphere,
|
|
42
232
|
encapsulating the spirit of adventure and joy that 'AGI PoLang' promises to deliver.
|
|
43
233
|
```
|
|
44
234
|
|
|
@@ -47,12 +237,12 @@ class SDDesigner:
|
|
|
47
237
|
|
|
48
238
|
改进后的表达:
|
|
49
239
|
```text
|
|
50
|
-
Create a web UI page. Design a sleek and intuitive financial reports web page,
|
|
51
|
-
featuring a clean menu layout, seamless navigation,
|
|
52
|
-
and a comprehensive display of reports.
|
|
53
|
-
The website should embody a clear and organized typography, enhancing readability and user experience.
|
|
54
|
-
Incorporate dynamic lighting effects to highlight key financial data, simulating the precision and clarity of a well-managed budget.
|
|
55
|
-
The overall design should reflect the stability and growth of financial health,
|
|
240
|
+
Create a web UI page. Design a sleek and intuitive financial reports web page,
|
|
241
|
+
featuring a clean menu layout, seamless navigation,
|
|
242
|
+
and a comprehensive display of reports.
|
|
243
|
+
The website should embody a clear and organized typography, enhancing readability and user experience.
|
|
244
|
+
Incorporate dynamic lighting effects to highlight key financial data, simulating the precision and clarity of a well-managed budget.
|
|
245
|
+
The overall design should reflect the stability and growth of financial health,
|
|
56
246
|
serving as a visual metaphor for the solid foundation and strategic planning required in personal and corporate finance.
|
|
57
247
|
```
|
|
58
248
|
|
|
@@ -62,33 +252,33 @@ class SDDesigner:
|
|
|
62
252
|
将产品置于一种原始风景的背景之前,该风景包括山脉、湖泊和生动的绿色植被。
|
|
63
253
|
包括花朵、石头,可能还有一两只鹿在背景中,以增强户外、新鲜的感觉。
|
|
64
254
|
使用明亮的自然光照强调产品,并确保构图平衡,色彩搭配和谐,与品牌设计相得益彰。
|
|
65
|
-
|
|
255
|
+
|
|
66
256
|
改进后的表达:
|
|
67
257
|
```text
|
|
68
|
-
Generate a photorealistic mockup of a sunscreen product displayed in a serene natural setting.
|
|
69
|
-
The product should be centered in the frame, with its label clearly visible.
|
|
70
|
-
Position the product against a backdrop of a pristine landscape featuring a mountain, a lake, and vibrant greenery.
|
|
71
|
-
Include natural elements like flowers, rocks, and possibly a deer or two in the background to enhance the outdoor, fresh feel.
|
|
72
|
-
Use bright, natural lighting to highlight the product, and ensure the composition is balanced with a harmonious color palette
|
|
258
|
+
Generate a photorealistic mockup of a sunscreen product displayed in a serene natural setting.
|
|
259
|
+
The product should be centered in the frame, with its label clearly visible.
|
|
260
|
+
Position the product against a backdrop of a pristine landscape featuring a mountain, a lake, and vibrant greenery.
|
|
261
|
+
Include natural elements like flowers, rocks, and possibly a deer or two in the background to enhance the outdoor, fresh feel.
|
|
262
|
+
Use bright, natural lighting to highlight the product, and ensure the composition is balanced with a harmonious color palette
|
|
73
263
|
that complements the brand's design.
|
|
74
264
|
```
|
|
75
265
|
|
|
76
266
|
用户需求:
|
|
77
|
-
一个扎着双马尾、手持棒球棒的女人,走在走廊上。灯光转变为危险的红色,营造出紧张的黑色电影风格氛围。
|
|
267
|
+
一个扎着双马尾、手持棒球棒的女人,走在走廊上。灯光转变为危险的红色,营造出紧张的黑色电影风格氛围。
|
|
78
268
|
|
|
79
269
|
改进后的表达:
|
|
80
270
|
```text
|
|
81
|
-
A slow dolly-in camera follows a woman with pigtails holding a baseball bat as she walks down a dimly lit hallway.
|
|
271
|
+
A slow dolly-in camera follows a woman with pigtails holding a baseball bat as she walks down a dimly lit hallway.
|
|
82
272
|
The lighting shifts to a menacing red, creating a tense, noir-style atmosphere with echoing footsteps adding suspense.
|
|
83
273
|
```
|
|
84
274
|
|
|
85
275
|
现在让我们开始一个新的任务。
|
|
86
|
-
|
|
276
|
+
|
|
87
277
|
用户需求:
|
|
88
278
|
{{ query }}
|
|
89
279
|
|
|
90
280
|
改进后的表达(改进后的表达请用 ```text ```进行包裹):
|
|
91
|
-
|
|
281
|
+
"""
|
|
92
282
|
|
|
93
283
|
def run(self, query: str):
|
|
94
284
|
enhanced_query_str = (
|
|
@@ -108,11 +298,12 @@ class SDDesigner:
|
|
|
108
298
|
}
|
|
109
299
|
]
|
|
110
300
|
)
|
|
111
|
-
|
|
301
|
+
|
|
112
302
|
image_data = base64.b64decode(response[0].output)
|
|
113
303
|
with open("output.jpg", "wb") as f:
|
|
114
304
|
f.write(image_data)
|
|
115
305
|
|
|
306
|
+
|
|
116
307
|
class SVGDesigner:
|
|
117
308
|
def __init__(self, args: AutoCoderArgs, llm: byzerllm.ByzerLLM):
|
|
118
309
|
self.llm = llm
|
|
@@ -149,6 +340,7 @@ class SVGDesigner:
|
|
|
149
340
|
|
|
150
341
|
def _to_png(self, svg_code: str):
|
|
151
342
|
import cairosvg
|
|
343
|
+
|
|
152
344
|
cairosvg.svg2svg(bytestring=svg_code, write_to="output.svg")
|
|
153
345
|
cairosvg.svg2png(bytestring=svg_code, write_to="output.png")
|
|
154
346
|
|
|
@@ -163,12 +355,12 @@ class SVGDesigner:
|
|
|
163
355
|
|
|
164
356
|
将上面的 lisp 代码转换为 svg 代码。使用 ```svg ```包裹输出。
|
|
165
357
|
注意:
|
|
166
|
-
1. 根据操作系统选择合适的可用字体,优先使用系统中可用的字体。
|
|
358
|
+
1. 根据操作系统选择合适的可用字体,优先使用系统中可用的字体。
|
|
167
359
|
2. 如果指定的字体不可用,请使用系统默认的字体。
|
|
168
360
|
3. 对于中英文混合的文本,请使用不同的字体。
|
|
169
361
|
"""
|
|
170
362
|
return {
|
|
171
|
-
"system_info":self.system_info,
|
|
363
|
+
"system_info": self.system_info,
|
|
172
364
|
}
|
|
173
365
|
|
|
174
366
|
@byzerllm.prompt()
|