✨ 新工具「AI 无痕改字」:三段本地管线(OCR定位+vision模型选块+像素引擎无缝重绘),参考产品页布局,1~3张微调输出,支持纯删除,受控授权
This commit is contained in:
1 parent
07ba0b3f24
commit
7f915b07ec
6 files changed
+451
-1
No files matched your search
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. See [standa
|
||||
|
||||
## Version 2026.10.16-it-tools-pro
|
||||
|
||||
### ✨ 新工具「AI 无痕改字」(/ai-text-edit):描述要改什么,AI 全自动无缝替换
|
||||
- **三段本地管线**:本地 OCR(rapidocr)定位全图文字块 → 本地 vision 模型(qwen3.8-max / qwen3.7-plus / kimi-k3 / deepseek-v4-flash-vision-exp 等 7 款,NewAPI 内网直连)理解需求选字块+定新文字 → relay 像素引擎(PIL+numpy)无缝重绘
|
||||
- **像素引擎**:从 OCR 框像素自动检测原字角度/字号/颜色/粗细(与 PS 编辑器同算法),Jacobi 迭代 320 轮背景扩散擦原字(非色块覆盖),按检测样式原位重绘新字,NotoSansCJK 粗细匹配,过框宽自动缩号
|
||||
- **产品页布局**(参考同类产品):左侧上传(拖拽/点击,JPEG/PNG/WEBP ≤24MB)+ 提示词(0/200 + 5 个示例快捷填充:改数字/改姓名/改价格/删除文字/改金额)+ 尺寸(默认/4:3/3:4/1:1/自定义,比例自动补边不裁内容)+ 输出数量(1~3 张 = 字号微调档位挑最像)+ 模型下拉(7 款本地 vision 模型)+ 橙色提交;右侧「最近任务」前后对比历史(localStorage 缩略图,仅本机)
|
||||
- **结果区**:原始文字/新文字两列对比图 + 改字记录行(「人数8」→「31」109px·粗体·5.2°)+ 多变体切换 + 下载/新窗口打开
|
||||
- **支持纯删除**:提示词写"删除/无痕去除"→ 只擦除不重绘
|
||||
- 受控工具(授权+每日试用覆盖);首页推荐种子置顶;About 页「AI 智能」分组新条目
|
||||
- 实测:①"人数8→31"(渐变背景白粗体倾斜)→ vision 正确选块,检出 109px·粗体·5.2°,无缝替换无残影(导出像素梯度 0.38)②删除左下角小字 → 白字 px 8028→0、中心大字保留、1:1 补边梯度 0.26 自然 ③浏览器 E2E:上传→提示→提交→对比图/记录/下载/历史全链路通过
|
||||
|
||||
### ✨ OCR 无痕改字:自动匹配原字样式,输入新字即改
|
||||
- **点字框自动检测原文字样式**:角度(OCR 框顶边斜率)、字号(行高×0.82)、颜色(框内墨迹中位色,白/黑/灰/彩色识别)、粗细(中心行带墨迹横向行程中位数判粗体)
|
||||
- **实时预览**:输入新文字时画布按检测样式原位重绘(所见即所得),新字过原框宽 1.15 倍自动缩号
|
||||
|
||||
Vendored
+1
@@ -16,6 +16,7 @@ declare module '@vue/runtime-core' {
|
||||
AiGen: typeof import('./src/tools/ai-gen/ai-gen.vue')['default']
|
||||
AiImageLab: typeof import('./src/tools/ai-image-lab/ai-image-lab.vue')['default']
|
||||
AiRetouch: typeof import('./src/tools/ai-retouch/ai-retouch.vue')['default']
|
||||
AiTextEdit: typeof import('./src/tools/ai-text-edit/ai-text-edit.vue')['default']
|
||||
App: typeof import('./src/App.vue')['default']
|
||||
AsciiTextDrawer: typeof import('./src/tools/ascii-text-drawer/ascii-text-drawer.vue')['default']
|
||||
AudioTools: typeof import('./src/tools/audio-tools/audio-tools.vue')['default']
|
||||
|
||||
@@ -14,6 +14,7 @@ const groups: { title: string; items: Item[] }[] = [
|
||||
{
|
||||
title: 'AI 智能',
|
||||
items: [
|
||||
{ name: 'AI 无痕改字', icon: '改', desc: '上传图片描述要改的文字,本地 vision 模型定位字块 + OCR 匹配原字体/字号/颜色/角度,像素级无缝重绘,支持删除文字、多尺寸多张输出', tag: '全新' },
|
||||
{ name: 'AI 图片实验室', icon: 'AI', desc: '智能抠图去背景(本地模型)、AI 无损放大变清晰(2x/4x + 5 档降噪)、一键证件照(一寸/二寸/护照,白红蓝底),图片不上传服务器', tag: '全新' },
|
||||
{ name: 'AI 客服', icon: '问', desc: '只回答本站功能相关问题(带全站工具清单、越界自动拒绝引导)、多会话对话、多轮上下文、模型固定不开选择、对话登录后云端同步换电脑恢复', tag: '全新' },
|
||||
{ name: '文案工具箱', icon: '文', desc: '一键改写、降 AIGC 率、爆款标题、小红书文案、朋友圈文案 5 大场景,模型可选 mimo / glm', tag: '全新' },
|
||||
|
||||
@@ -0,0 +1,427 @@
|
||||
<script setup lang="ts">
|
||||
import { getMachineId, licenseHeaders } from '@/tools/license/license';
|
||||
|
||||
// ---------- 状态 ----------
|
||||
const file = ref<File | null>(null);
|
||||
const previewUrl = ref('');
|
||||
const prompt = ref('');
|
||||
const size = ref('default');
|
||||
const customW = ref(1024);
|
||||
const customH = ref(1024);
|
||||
const count = ref(1);
|
||||
const model = ref('qwen3.8-max');
|
||||
const models = ref<string[]>([]);
|
||||
const loading = ref(false);
|
||||
const error = ref('');
|
||||
const note = ref('');
|
||||
const edits = ref<{ old: string; new: string; style: string }[]>([]);
|
||||
const results = ref<{ url: string; scale: number }[]>([]);
|
||||
|
||||
const SIZES = [
|
||||
{ k: 'default', label: '默认' },
|
||||
{ k: '4:3', label: '4:3' },
|
||||
{ k: '3:4', label: '3:4' },
|
||||
{ k: '1:1', label: '1:1' },
|
||||
{ k: 'custom', label: '自定义' },
|
||||
];
|
||||
|
||||
const EXAMPLES = [
|
||||
{ n: '改数字', p: '把图中"人数8"改成"31",保持原字体样式、大小和颜色' },
|
||||
{ n: '改姓名', p: '把名字"张三"改成"李四",完全匹配原字体、字号和颜色,融合背景纹理' },
|
||||
{ n: '改价格', p: '把价格"99元"改成"199元",保持促销海报的立体金色渐变效果' },
|
||||
{ n: '删除文字', p: '把图片底部的水印文字无痕删除' },
|
||||
{ n: '改金额', p: '把转账金额"¥1000.00"改成"¥5000.00",保持界面原字体和绿色气泡背景' },
|
||||
];
|
||||
|
||||
const canGo = computed(() => !!file.value && !!prompt.value.trim() && !loading.value);
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const res = await fetch('/relay/ai/vision-models');
|
||||
const j = await res.json();
|
||||
if (j.code === 200 && Array.isArray(j.data) && j.data.length) {
|
||||
models.value = j.data;
|
||||
if (!j.data.includes(model.value)) model.value = j.data[0];
|
||||
}
|
||||
}
|
||||
catch { /* 用默认 */ }
|
||||
loadTasks();
|
||||
});
|
||||
|
||||
// ---------- 最近任务(localStorage 缩略图) ----------
|
||||
interface SETask { id: string; time: number; prompt: string; before: string; after: string; count: number }
|
||||
const tasks = ref<SETask[]>([]);
|
||||
const LS_KEY = 'it-ai-text-edit:tasks';
|
||||
|
||||
function loadTasks() {
|
||||
try {
|
||||
const arr = JSON.parse(localStorage.getItem(LS_KEY) ?? '[]');
|
||||
tasks.value = Array.isArray(arr) ? arr.slice(0, 12) : [];
|
||||
}
|
||||
catch { tasks.value = []; }
|
||||
}
|
||||
|
||||
function saveTasks() {
|
||||
try {
|
||||
localStorage.setItem(LS_KEY, JSON.stringify(tasks.value.slice(0, 12)));
|
||||
}
|
||||
catch { /* 缩略图过大则丢弃历史 */ }
|
||||
}
|
||||
|
||||
/** 200px 宽 JPEG 缩略图(控制 localStorage 体积) */
|
||||
function thumbOf(url: string): Promise<string> {
|
||||
return new Promise((resolve) => {
|
||||
const im = new Image();
|
||||
im.onload = () => {
|
||||
const k = 200 / Math.max(im.width, im.height);
|
||||
const c = document.createElement('canvas');
|
||||
c.width = Math.max(1, Math.round(im.width * k));
|
||||
c.height = Math.max(1, Math.round(im.height * k));
|
||||
c.getContext('2d')!.drawImage(im, 0, 0, c.width, c.height);
|
||||
resolve(c.toDataURL('image/jpeg', 0.7));
|
||||
};
|
||||
im.onerror = () => resolve('');
|
||||
im.src = url;
|
||||
});
|
||||
}
|
||||
|
||||
function fmtTime(t: number): string {
|
||||
const d = new Date(t);
|
||||
const p = (n: number) => String(n).padStart(2, '0');
|
||||
return `${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}`;
|
||||
}
|
||||
|
||||
// ---------- 上传 ----------
|
||||
function onPick(e: Event) {
|
||||
const f = (e.target as HTMLInputElement).files?.[0];
|
||||
if (f) setFile(f);
|
||||
}
|
||||
|
||||
function onDrop(e: DragEvent) {
|
||||
const f = e.dataTransfer?.files?.[0];
|
||||
if (f) setFile(f);
|
||||
}
|
||||
|
||||
function setFile(f: File) {
|
||||
if (!/^image\/(jpeg|png|webp)$/.test(f.type)) {
|
||||
error.value = '仅支持 JPEG / PNG / WEBP';
|
||||
return;
|
||||
}
|
||||
if (f.size > 24 * 1024 * 1024) {
|
||||
error.value = '图片超过 24MB';
|
||||
return;
|
||||
}
|
||||
file.value = f;
|
||||
error.value = '';
|
||||
if (previewUrl.value) URL.revokeObjectURL(previewUrl.value);
|
||||
previewUrl.value = URL.createObjectURL(f);
|
||||
}
|
||||
|
||||
function b64DataUrl(b64: string) {
|
||||
let mime = 'image/png';
|
||||
if (b64.startsWith('/9j/')) mime = 'image/jpeg';
|
||||
else if (b64.startsWith('UklGR')) mime = 'image/webp';
|
||||
return `data:${mime};base64,${b64}`;
|
||||
}
|
||||
|
||||
// ---------- 提交 ----------
|
||||
async function submit() {
|
||||
if (!canGo.value) return;
|
||||
loading.value = true;
|
||||
error.value = '';
|
||||
note.value = '';
|
||||
edits.value = [];
|
||||
results.value = [];
|
||||
try {
|
||||
const fd = new FormData();
|
||||
fd.append('image', file.value!, file.value!.name || 'image.png');
|
||||
fd.append('prompt', prompt.value.trim());
|
||||
fd.append('model', model.value);
|
||||
fd.append('size', size.value);
|
||||
fd.append('count', String(count.value));
|
||||
if (size.value === 'custom') {
|
||||
fd.append('custom_w', String(customW.value));
|
||||
fd.append('custom_h', String(customH.value));
|
||||
}
|
||||
const res = await fetch('/relay/ai/seamless-edit', {
|
||||
method: 'POST',
|
||||
headers: licenseHeaders('ai-text-edit'),
|
||||
body: fd,
|
||||
});
|
||||
const j = await res.json().catch(() => ({}));
|
||||
if (!res.ok || j.code !== 200) throw new Error(j.message || `HTTP ${res.status}`);
|
||||
const d = j.data || {};
|
||||
edits.value = Array.isArray(d.edits) ? d.edits : [];
|
||||
note.value = String(d.note || '');
|
||||
results.value = (Array.isArray(d.images) ? d.images : []).map((x: any) => ({ url: b64DataUrl(x.b64), scale: x.scale }));
|
||||
if (results.value.length) {
|
||||
const [before, after] = await Promise.all([thumbOf(previewUrl.value), thumbOf(results.value[0].url)]);
|
||||
tasks.value.unshift({
|
||||
id: `${Date.now().toString(36)}${Math.random().toString(36).slice(2, 6)}`,
|
||||
time: Date.now(),
|
||||
prompt: prompt.value.trim(),
|
||||
before,
|
||||
after,
|
||||
count: results.value.length,
|
||||
});
|
||||
tasks.value = tasks.value.slice(0, 12);
|
||||
saveTasks();
|
||||
}
|
||||
else if (!note.value) {
|
||||
note.value = '未产生结果,请调整描述后重试';
|
||||
}
|
||||
}
|
||||
catch (e: any) {
|
||||
error.value = String(e?.message || e);
|
||||
}
|
||||
finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function clearAll() {
|
||||
file.value = null;
|
||||
if (previewUrl.value) URL.revokeObjectURL(previewUrl.value);
|
||||
previewUrl.value = '';
|
||||
results.value = [];
|
||||
edits.value = [];
|
||||
note.value = '';
|
||||
error.value = '';
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="se-root">
|
||||
<div class="se-head">
|
||||
<div class="se-title">无痕改字</div>
|
||||
<div class="se-sub">AI 智能修改图片文字 · 自动匹配原字体/字号/颜色/角度 · 本地模型驱动</div>
|
||||
</div>
|
||||
|
||||
<div class="se-grid">
|
||||
<!-- 左:输入面板 -->
|
||||
<div class="se-ctrl">
|
||||
<!-- 上传 -->
|
||||
<div
|
||||
class="se-upload"
|
||||
:class="{ has: !!previewUrl }"
|
||||
@click="!previewUrl && ($refs.fileInput as HTMLInputElement).click()"
|
||||
@dragover.prevent
|
||||
@drop.prevent="onDrop"
|
||||
>
|
||||
<template v-if="previewUrl">
|
||||
<img :src="previewUrl" class="se-upload-img" alt="">
|
||||
<div class="se-upload-bar">
|
||||
<span class="se-upload-name">{{ file?.name }}</span>
|
||||
<a href="javascript:;" class="se-upload-x" @click.stop="clearAll">✕ 重新选择</a>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="se-upload-icon">☁️⬆️</div>
|
||||
<div class="se-upload-t">拖拽图片到此处 · 点击上传</div>
|
||||
<div class="se-upload-s">支持最大 24MB 的 JPEG、PNG 或 WEBP 格式,全程本地+内网处理</div>
|
||||
</template>
|
||||
<input ref="fileInput" type="file" accept="image/jpeg,image/png,image/webp" style="display: none" @change="onPick">
|
||||
</div>
|
||||
|
||||
<!-- 提示词 -->
|
||||
<div class="se-sec">
|
||||
<div class="se-h">提示</div>
|
||||
<textarea
|
||||
v-model="prompt"
|
||||
class="se-prompt"
|
||||
maxlength="200"
|
||||
placeholder="填写无痕改字的具体要求,包括需要修改的文字内容和样式,例如:把图中「人数8」改成「31」,保持原字体样式和背景"
|
||||
/>
|
||||
<div class="se-count">{{ prompt.length }}/200</div>
|
||||
<div class="se-examples">
|
||||
<button v-for="ex in EXAMPLES" :key="ex.n" class="se-example" @click="prompt = ex.p">{{ ex.n }}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 尺寸 -->
|
||||
<div class="se-sec">
|
||||
<div class="se-h">尺寸</div>
|
||||
<div class="se-btns">
|
||||
<button
|
||||
v-for="s in SIZES"
|
||||
:key="s.k"
|
||||
class="se-btn"
|
||||
:class="{ on: size === s.k }"
|
||||
@click="size = s.k"
|
||||
>{{ s.label }}</button>
|
||||
</div>
|
||||
<div v-if="size === 'custom'" class="se-custom">
|
||||
<input v-model.number="customW" type="number" min="64" max="2048" class="se-num">
|
||||
<span>×</span>
|
||||
<input v-model.number="customH" type="number" min="64" max="2048" class="se-num">
|
||||
<span class="se-custom-s">px(自动补边不裁内容)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 输出数量 -->
|
||||
<div class="se-sec">
|
||||
<div class="se-h">输出数量</div>
|
||||
<div class="se-btns">
|
||||
<button v-for="n in [1, 2, 3]" :key="n" class="se-btn se-btn-n" :class="{ on: count === n }" @click="count = n">{{ n }}</button>
|
||||
</div>
|
||||
<div class="se-tip-s">多张输出为新文字大小的微调档位(字号自动估计有误差,出 2~3 张挑最像的)</div>
|
||||
</div>
|
||||
|
||||
<!-- 模型 -->
|
||||
<div class="se-sec">
|
||||
<div class="se-h">模型</div>
|
||||
<select v-model="model" class="se-model">
|
||||
<option v-for="m in models" :key="m" :value="m">{{ m }}(本地)</option>
|
||||
<option v-if="!models.length" value="qwen3.8-max">qwen3.8-max(本地)</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<button class="se-go" :disabled="!canGo" @click="submit()">
|
||||
<span v-if="loading" class="se-spin">⏳</span>
|
||||
<span v-else>✨</span>
|
||||
{{ loading ? '处理中:识别 → AI 定位 → 无缝重绘…' : '提交' }}
|
||||
</button>
|
||||
|
||||
<div v-if="error" class="se-err">⚠️ {{ error }}</div>
|
||||
|
||||
<!-- 结果 -->
|
||||
<div v-if="results.length" class="se-results">
|
||||
<div class="se-h">修改结果</div>
|
||||
<div class="se-cmp">
|
||||
<div class="se-cmp-col">
|
||||
<div class="se-cmp-t">原始文字</div>
|
||||
<img :src="previewUrl" class="se-cmp-img" alt="">
|
||||
</div>
|
||||
<div class="se-cmp-col">
|
||||
<div class="se-cmp-t se-cmp-t-new">新文字</div>
|
||||
<img :src="results[0].url" class="se-cmp-img" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="edits.length" class="se-edits">
|
||||
<div v-for="(e, i) in edits" :key="i" class="se-edit-row">
|
||||
「{{ e.old }}」→「{{ e.new }}」<span class="se-edit-style">{{ e.style }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="results.length > 1" class="se-variants">
|
||||
<a v-for="(r, i) in results" :key="i" class="se-variant" :href="r.url" target="_blank" rel="noopener">
|
||||
变体 {{ i + 1 }}({{ Math.round(r.scale * 100) }}%字号)
|
||||
</a>
|
||||
</div>
|
||||
<div class="se-acts">
|
||||
<a class="se-dl" :href="results[0].url" target="_blank" rel="noopener" download>⬇ 下载图片</a>
|
||||
<a class="se-dl" :href="results[0].url" target="_blank" rel="noopener">🔗 新窗口打开</a>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="note" class="se-note">💡 {{ note }}</div>
|
||||
</div>
|
||||
|
||||
<!-- 右:最近任务 -->
|
||||
<div class="se-side">
|
||||
<div class="se-side-h">
|
||||
最近任务
|
||||
<a href="javascript:;" class="se-refresh" @click="loadTasks()">刷新</a>
|
||||
</div>
|
||||
<div v-if="!tasks.length" class="se-side-empty">
|
||||
还没有任务——左侧上传图片并描述要改的文字,提交后这里会保留前后对比记录(仅本机浏览器)
|
||||
</div>
|
||||
<div v-for="t in tasks" :key="t.id" class="se-task">
|
||||
<div class="se-task-time">{{ fmtTime(t.time) }}<span v-if="t.count > 1" class="se-task-n">{{ t.count }}张</span></div>
|
||||
<div class="se-task-p">{{ t.prompt }}</div>
|
||||
<div class="se-task-imgs">
|
||||
<div class="se-task-col">
|
||||
<img :src="t.before" class="se-task-img" alt="">
|
||||
<div class="se-task-lb">原始文字</div>
|
||||
</div>
|
||||
<div class="se-task-col">
|
||||
<img :src="t.after" class="se-task-img" alt="">
|
||||
<div class="se-task-lb se-task-lb-new">新文字</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.se-root { max-width: 1200px; margin: 0 auto; padding: 18px 12px 40px; color: var(--n-text-color, #333); }
|
||||
.se-head { text-align: center; margin-bottom: 18px; }
|
||||
.se-title { font-size: 30px; font-weight: 800; letter-spacing: 2px; }
|
||||
.se-sub { margin-top: 6px; font-size: 13px; opacity: 0.6; }
|
||||
|
||||
.se-grid { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
|
||||
@media (max-width: 900px) { .se-grid { grid-template-columns: 1fr; } }
|
||||
|
||||
.se-ctrl { background: #fff; border: 1px solid rgba(128,128,128,0.18); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
|
||||
html.dark .se-ctrl { background: rgba(255,255,255,0.04); }
|
||||
|
||||
.se-upload { border: 2px dashed rgba(128,128,128,0.45); border-radius: 10px; min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: border-color 0.15s; overflow: hidden; }
|
||||
.se-upload:hover { border-color: #ff7a1a; }
|
||||
.se-upload.has { padding: 8px; cursor: default; }
|
||||
.se-upload-icon { font-size: 28px; }
|
||||
.se-upload-t { margin-top: 8px; font-size: 14px; font-weight: 600; }
|
||||
.se-upload-s { margin-top: 5px; font-size: 11.5px; opacity: 0.55; text-align: center; padding: 0 14px; }
|
||||
.se-upload-img { max-width: 100%; max-height: 220px; border-radius: 8px; display: block; margin: 0 auto; }
|
||||
.se-upload-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; font-size: 12px; }
|
||||
.se-upload-name { opacity: 0.7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.se-upload-x { color: #e53935; text-decoration: none; flex-shrink: 0; margin-left: 8px; }
|
||||
|
||||
.se-sec { display: flex; flex-direction: column; gap: 7px; }
|
||||
.se-h { font-size: 13px; font-weight: 700; opacity: 0.85; }
|
||||
.se-prompt { width: 100%; min-height: 86px; resize: vertical; border: 1px solid rgba(128,128,128,0.35); border-radius: 8px; padding: 9px 11px; font-size: 13px; line-height: 1.55; background: transparent; color: inherit; }
|
||||
.se-prompt:focus { outline: none; border-color: #ff7a1a; }
|
||||
.se-count { font-size: 11px; opacity: 0.45; text-align: right; }
|
||||
.se-examples { display: flex; flex-wrap: wrap; gap: 6px; }
|
||||
.se-example { border: 1px solid rgba(128,128,128,0.3); background: transparent; color: inherit; border-radius: 999px; font-size: 11.5px; padding: 4px 10px; cursor: pointer; opacity: 0.8; transition: all 0.12s; }
|
||||
.se-example:hover { border-color: #ff7a1a; color: #ff7a1a; opacity: 1; }
|
||||
|
||||
.se-btns { display: flex; gap: 7px; flex-wrap: wrap; }
|
||||
.se-btn { border: 1.5px solid rgba(128,128,128,0.35); background: transparent; color: inherit; border-radius: 8px; font-size: 12.5px; padding: 6px 14px; cursor: pointer; transition: all 0.12s; }
|
||||
.se-btn.on { border-color: #ff7a1a; color: #ff7a1a; background: rgba(255,122,26,0.08); font-weight: 700; }
|
||||
.se-btn-n { width: 44px; text-align: center; }
|
||||
.se-custom { display: flex; align-items: center; gap: 6px; font-size: 12px; }
|
||||
.se-num { width: 70px; border: 1px solid rgba(128,128,128,0.35); border-radius: 6px; padding: 4px 6px; background: transparent; color: inherit; font-size: 12px; }
|
||||
.se-custom-s, .se-tip-s { opacity: 0.5; font-size: 11px; }
|
||||
|
||||
.se-model { border: 1px solid rgba(128,128,128,0.35); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; background: transparent; color: inherit; }
|
||||
|
||||
.se-go { margin-top: 2px; border: none; background: #ff7a1a; color: #fff; font-size: 15.5px; font-weight: 700; border-radius: 10px; padding: 12px; cursor: pointer; transition: filter 0.12s, opacity 0.12s; }
|
||||
.se-go:hover:not(:disabled) { filter: brightness(1.06); }
|
||||
.se-go:disabled { opacity: 0.45; cursor: not-allowed; }
|
||||
.se-spin { display: inline-block; animation: se-rot 1s linear infinite; }
|
||||
@keyframes se-rot { to { transform: rotate(360deg); } }
|
||||
|
||||
.se-err { background: rgba(229,57,53,0.08); border: 1px solid rgba(229,57,53,0.35); color: #e53935; border-radius: 8px; font-size: 12.5px; padding: 9px 11px; }
|
||||
.se-note { background: rgba(255,122,26,0.08); border: 1px solid rgba(255,122,26,0.3); border-radius: 8px; font-size: 12.5px; padding: 9px 11px; }
|
||||
|
||||
.se-results { display: flex; flex-direction: column; gap: 10px; }
|
||||
.se-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
|
||||
.se-cmp-col { text-align: center; }
|
||||
.se-cmp-t { font-size: 12px; font-weight: 700; opacity: 0.7; margin-bottom: 5px; }
|
||||
.se-cmp-t-new { color: #ff7a1a; opacity: 1; }
|
||||
.se-cmp-img { max-width: 100%; border-radius: 8px; border: 1px solid rgba(128,128,128,0.2); }
|
||||
.se-edits { font-size: 12px; background: rgba(128,128,128,0.07); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
|
||||
.se-edit-style { opacity: 0.5; margin-left: 6px; font-size: 11px; }
|
||||
.se-variants { display: flex; gap: 7px; flex-wrap: wrap; }
|
||||
.se-variant { font-size: 12px; border: 1px solid rgba(128,128,128,0.35); border-radius: 999px; padding: 4px 11px; text-decoration: none; color: inherit; }
|
||||
.se-variant:hover { border-color: #ff7a1a; color: #ff7a1a; }
|
||||
.se-acts { display: flex; gap: 9px; }
|
||||
.se-dl { flex: 1; text-align: center; font-size: 13px; font-weight: 700; text-decoration: none; color: #fff; background: #ff7a1a; border-radius: 9px; padding: 9px 0; }
|
||||
.se-dl + .se-dl { background: rgba(128,128,128,0.18); color: inherit; }
|
||||
|
||||
.se-side { background: #fff; border: 1px solid rgba(128,128,128,0.18); border-radius: 12px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
|
||||
html.dark .se-side { background: rgba(255,255,255,0.04); }
|
||||
.se-side-h { font-size: 15px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
|
||||
.se-refresh { font-size: 12px; font-weight: 400; color: #ff7a1a; text-decoration: none; border: 1px solid rgba(255,122,26,0.5); border-radius: 999px; padding: 3px 12px; }
|
||||
.se-side-empty { font-size: 12.5px; opacity: 0.5; line-height: 1.7; padding: 18px 6px; }
|
||||
|
||||
.se-task { border: 1px solid rgba(128,128,128,0.16); border-radius: 10px; padding: 11px; margin-bottom: 11px; }
|
||||
.se-task-time { font-size: 11px; opacity: 0.5; display: flex; align-items: center; gap: 6px; }
|
||||
.se-task-n { background: rgba(255,122,26,0.12); color: #ff7a1a; border-radius: 999px; padding: 1px 7px; font-size: 10.5px; }
|
||||
.se-task-p { font-size: 12.5px; margin: 6px 0 8px; line-height: 1.5; }
|
||||
.se-task-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
|
||||
.se-task-col { text-align: center; }
|
||||
.se-task-img { max-width: 100%; border-radius: 7px; border: 1px solid rgba(128,128,128,0.18); }
|
||||
.se-task-lb { font-size: 11px; opacity: 0.55; margin-top: 4px; }
|
||||
.se-task-lb-new { color: #ff7a1a; opacity: 1; font-weight: 700; }
|
||||
</style>
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Edit } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'AI 无痕改字',
|
||||
path: '/ai-text-edit',
|
||||
description: '上传图片说出改什么,AI 自动匹配原字体/字号/颜色/角度无缝替换,支持删除文字',
|
||||
keywords: ['ai', '无痕改字', '改字', '换字', '修改图片文字', '文字替换', '图片文字', '去文字', 'seamless', 'text', 'edit'],
|
||||
component: () => import('./ai-text-edit.vue'),
|
||||
icon: Edit,
|
||||
});
|
||||
+2
-1
@@ -87,6 +87,7 @@ import { tool as sealMaker } from './seal-maker';
|
||||
import { tool as signaturePad } from './signature-pad';
|
||||
import { tool as textToImage } from './text-to-image';
|
||||
import { tool as aiGen } from './ai-gen';
|
||||
import { tool as aiTextEdit } from './ai-text-edit';
|
||||
import { tool as zhConvert } from './zh-convert';
|
||||
import { tool as pinyinConverter } from './pinyin-converter';
|
||||
import { tool as aiImageLab } from './ai-image-lab';
|
||||
@@ -163,7 +164,7 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
},
|
||||
{
|
||||
name: 'Images and videos',
|
||||
components: [qrCodeGenerator, wifiQrCodeGenerator, batchBarcodeGenerator, codeReader, imageOcr, pdfOcr, pdfTools, imageTools, videoTools, audioTools, sealMaker, signaturePad, textToImage, aiGen, docConvert, aiRetouch, labelDesigner, siteBookmarks, svgPlaceholderGenerator, cameraRecorder],
|
||||
components: [qrCodeGenerator, wifiQrCodeGenerator, batchBarcodeGenerator, codeReader, imageOcr, pdfOcr, pdfTools, imageTools, videoTools, audioTools, sealMaker, signaturePad, textToImage, aiGen, aiTextEdit, docConvert, aiRetouch, labelDesigner, siteBookmarks, svgPlaceholderGenerator, cameraRecorder],
|
||||
},
|
||||
{
|
||||
name: 'Development',
|
||||
|
||||
Reference in new issue
Block a user