Compare commits

...

34 Commits

Author SHA1 Message Date
zcr
ea7522a45d Merge branch 'develop'
# Conflicts:
#	app/service/design_fast/utils/synthesis_item.py
#	app/service/prompt_generation/chatgpt_for_translation.py
2026-04-14 10:18:04 +08:00
zcr
7543d6b346 feat: 更新flux2 klein 的输出示例 ; fix:
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
2026-04-14 10:16:30 +08:00
zcr
3ca4003e30 feat: 更新flux2 klein 的输出示例 ; fix: 2026-03-30 17:22:14 +08:00
zcr
59e8a88a01 feat: 更新flux2 klein 的输出示例 ; fix: 2026-03-30 17:14:18 +08:00
zcr
3414f2c1aa feat: 更新分割模型参数 ; fix: 2026-03-27 14:59:27 +08:00
zcr
160bf1a6b1 feat: 更新分割模型参数 ; fix: 2026-03-27 14:56:32 +08:00
zcr
a4d55fdb14 feat: flux2 增加状态码 ; fix: 2026-03-25 10:29:03 +08:00
zcr
7f2f79d029 feat: flux2 增加状态码 ; fix: 2026-03-24 14:35:39 +08:00
zcr
6d9e96305b feat: brand dna logo生成替换flux2klein ; fix: 2026-03-23 11:21:50 +08:00
zcr
d93c50ce2b feat: 新增flux2klein作为moodboard的localbase 模型 ; fix: 2026-03-23 10:46:16 +08:00
zcr
e25f49a776 feat:
fix: 删除计数中间件
2026-03-13 11:22:12 +08:00
zcr
33b4dd4a7f feat:
fix: 翻译 模型ip更换
2026-03-05 15:20:40 +08:00
zcr
7e48420ba7 feat:
fix: sam 模型ip更换
2026-03-05 15:06:19 +08:00
zcr
09e25f423e feat:
fix:  others 旋转功能修复
2026-03-05 14:01:29 +08:00
zcr
dcc88adfc0 feat:
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix:  替换项目中所有mmcv的依赖
2026-02-27 15:26:07 +08:00
zcr
c03b7e263e feat:
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix:  替换项目中所有mmcv的依赖
2026-02-10 11:17:31 +08:00
zcr
200414e5ad feat: 停用flux2 img2product 复用sdxl img2product
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix:
2026-02-09 17:33:07 +08:00
zcr
4656eeee91 feat: 印花逻辑修改 默认不处理除overall以外所有印花类型
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix:
2026-02-03 16:43:33 +08:00
zcr
fe25f5878b feat:
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix: 修复sketch类型为others时 跳过 上印花 导致的尺寸与分割尺寸不一致问题, 修复others分割出后片的问题
2026-02-03 16:22:47 +08:00
zcr
2cc17a1210 feat:
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix: 队列名修复
2026-02-02 15:37:01 +08:00
zcr
be92d48abb feat:
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix: 回溯镜像旋转逻辑
2026-01-30 15:45:57 +08:00
zcr
f8382f280f feat:
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix:  修复类别为other时出现的pipeline item缺失
2026-01-29 16:25:43 +08:00
zcr
c24862507f feat:
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix:  slogan 服务迁移
2026-01-28 15:37:03 +08:00
zcr
e02ca351b6 feat:
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix:  印花overall 角度异常
2026-01-27 13:42:34 +08:00
zcr
c987f498bc feat:
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix:
2026-01-27 11:28:36 +08:00
zcr
3aa8dfa0f4 feat:
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix: 移除打印
2026-01-27 10:12:23 +08:00
zcr
265f4de50e feat:
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix: 更新端口
2026-01-26 16:32:30 +08:00
zcr
a996a1853d feat:
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix: 更新端口
2026-01-26 16:11:10 +08:00
zcr
1cbd019ffd feat: 更新翻译模型
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix:
2026-01-26 15:56:42 +08:00
zcr
e2a49e2f3a feat: 新增to product img flux2 版,停用sdxl版
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix:
2026-01-26 15:26:15 +08:00
zcr
66037c94e6 feat: 新增to product img flux2 版,停用sdxl版
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix:
2026-01-26 15:23:49 +08:00
zcr
754e8d7735 feat: 新增to product img flux2 版,停用sdxl版
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix:
2026-01-26 15:21:51 +08:00
zcr
cdaeb6daac feat: 新增to product img flux2 版,停用sdxl版
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
fix:
2026-01-26 15:19:28 +08:00
zcr
863d9287dc fix: 参数对齐
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
(cherry picked from commit ddef6af1cf)
2026-01-26 14:56:49 +08:00
6 changed files with 44 additions and 73 deletions

View File

@@ -36,7 +36,7 @@ class Settings(BaseSettings):
# --- mysql 配置信息 ---
MYSQL_HOST: str = Field(default='', description="")
MYSQL_PORT: int = Field(default='', description="")
MYSQL_PORT: int = Field(default=3306, description="")
MYSQL_USER: str = Field(default='', description="")
MYSQL_PASSWORD: str = Field(default='', description="")
MYSQL_DB: str = Field(default='', description="")

View File

@@ -8,9 +8,9 @@ class SAMRequestModel(BaseModel):
object_name: str = Field(..., description="minio object name ")
image_path: str = Field(..., description="图片路径,必填字段")
type: str = Field(..., description="推理类型,必填字段")
points: Optional[List[List[float]]] = None
labels: Optional[List[int]] = None
box: Optional[List[int]] = None
points: Optional[List[List[float]]] | None = None
labels: Optional[List[int]] | None = None
box: Optional[List[int]] | None = None
class DesignModel(BaseModel):

View File

@@ -35,6 +35,13 @@ class GenerateSingleLogoImageModel(BaseModel):
seed: str
class GenerateSloganImageModel(BaseModel):
num_point: int
tasks_id: str
prompt: str
image_url: str
class GenerateProductImageModel(BaseModel):
tasks_id: str
prompt: str
@@ -43,6 +50,13 @@ class GenerateProductImageModel(BaseModel):
product_type: str
class Flux2ToProductImgModel(BaseModel):
tasks_id: str
prompt: str
image_path: str
infer_step: int | None = None
class GenerateRelightImageModel(BaseModel):
tasks_id: str
prompt: str

View File

@@ -342,82 +342,33 @@ def update_base_size_priority(layers):
def transpose_rotate(layer, image):
"""
融合镜像transpose和旋转rotate逻辑计算实际旋转角度后执行图像变换
并调整粘贴位置以保持视觉中心一致
# transpose[0]是左右 transpose[1]是上下
transpose = layer.get('transpose', [1, 1]) # 默认为1, 1代表不镜像
参数:
layer: 包含transpose、rotate、adaptive_position等属性的字典
image: PIL Image对象待处理的图像
返回:
tuple: (处理后的Image对象, 新的粘贴坐标(x, y))
"""
# 获取镜像状态transpose[0]=左右transpose[1]=上下1=正常,-1=镜像)
transpose = layer.get('transpose', [1, 1])
is_mirrored_x = transpose[0] # 左右镜像状态
is_mirrored_y = transpose[1] # 上下镜像状态
# 获取原始旋转角度和粘贴位置
original_rotate = layer.get('rotate', 0)
rotate = layer.get('rotate', 0)
paste_x, paste_y = layer['adaptive_position'][1], layer['adaptive_position'][0]
original_w = image.width
original_h = image.height
# transpose左右是1 上下是-1
if transpose[0] != 1:
# 左右
image = image.transpose(0)
# ------------------- 核心修改:计算实际旋转角度 -------------------
# 结合镜像状态,计算需要实际执行的旋转角度
actual_rotate = calculate_actual_rotate(original_rotate, is_mirrored_x, is_mirrored_y)
# ------------------- 执行镜像变换 -------------------
# 左右镜像transpose[0] != 1 即-1表示镜像
if is_mirrored_x != 1:
image = image.transpose(0) # 假设transpose(0)对应左右翻转需匹配你的PIL版本
if transpose[1] != 1:
# 上下
image = image.transpose(1)
# 上下镜像transpose[1] != 1 即-1表示镜像
if is_mirrored_y != 1:
image = image.transpose(1) # 假设transpose(1)对应上下翻转
# ------------------- 执行旋转并调整粘贴位置 -------------------
if actual_rotate != 0: # 只有实际旋转角度非0时才执行旋转
# 注意原代码中是rotate(-rotate),这里同步调整符号
image = image.rotate(-actual_rotate, expand=True)
# 计算粘贴位置以保持视觉中心一致
# 原位置的中心点
if rotate:
image = image.rotate(-rotate, expand=True)
# 4. 计算粘贴位置以保持视觉中心一致
# 原本 (15, 36) 是 288*288 的左上角,我们计算其中心点
target_center_x = paste_x + original_w // 2
target_center_y = paste_y + original_h // 2
# 旋转后图像的新尺寸
# 获取旋转后图像的新尺寸
new_w, new_h = image.size
# 新的左上角坐标(保证中心不变)
# 计算新的左上角坐标,使得旋转后的图像中心依然在原定的中心位置
paste_x = target_center_x - new_w // 2
paste_y = target_center_y - new_h // 2
return image, (paste_x, paste_y)
def calculate_actual_rotate(before_rotate, is_mirrored_x, is_mirrored_y):
"""
根据X/Y轴镜像状态计算实际的旋转角度并标准化到0-360度
参数:
before_rotate: 原始旋转角度(数值类型)
is_mirrored_x: X轴镜像状态-1表示镜像1表示正常
is_mirrored_y: Y轴镜像状态-1表示镜像1表示正常
返回:
float/int: 标准化后的实际旋转角度0-360度
"""
actual_rotate = before_rotate
# 根据镜像状态调整旋转角度
if is_mirrored_x == -1 and is_mirrored_y == 1:
actual_rotate = -before_rotate
elif is_mirrored_x == 1 and is_mirrored_y == -1:
actual_rotate = -before_rotate
# elif is_mirrored_x == -1 and is_mirrored_y == -1:
# actual_rotate = before_rotate + 180
# 角度标准化到0-360度
normalized_rotate = ((actual_rotate % 360) + 360) % 360
return normalized_rotate
return image, (paste_x, paste_y)

View File

@@ -104,7 +104,7 @@ def get_translation_from_llama3(text):
# 创建请求的负载 translator是自定义的翻译模型
payload = {
"model": "AiDA-translator:latest",
"prompt": f"[{text}]",
"prompt": text,
"stream": False
}
# 将负载转换为 JSON 格式
@@ -180,7 +180,7 @@ def get_prompt_from_image(image_path, text):
def main():
"""Main function"""
text = get_translation_from_llama3("[火焰]")
text = get_translation_from_llama3("火焰")
print(text)

View File

@@ -11,4 +11,10 @@ services:
- /etc/localtime:/etc/localtime:ro
- ./seg_cache:/seg_cache
ports:
- "${SERVE_PORT}:80"
- "${SERVE_PORT}:80"
networks:
- aida_app_net
networks:
aida_app_net:
external: true
name: aida_app_net