feat: AI生图去图生图+适配全屏
- 移除图生图模式(NEWAPI无可用i2i), 只留文生图, 去模式tab与图片上传 - ai-gen入宽屏白名单(去600px限宽), 占满屏幕宽+可视高 - 左控制面板+右大结果区填满; 描述改'AI文生图' 验证: 无模式tab/上传框, maxWidth=none, body1293x780, 结果857x780 ✓ CHANGELOG记录
This commit is contained in:
1 parent
fdf3970387
commit
baa17ec08b
4 files changed
+69
-192
No files matched your search
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. See [standa
|
|||||||
|
|
||||||
## Version 2026.10.12-it-tools-pro
|
## Version 2026.10.12-it-tools-pro
|
||||||
|
|
||||||
|
### 🎨 AI 生图:去图生图 + 适配全屏
|
||||||
|
- 移除「图生图」模式(NEWAPI 无可用 i2i 通道),页面只保留文生图,去掉模式切换与图片上传
|
||||||
|
- `ai-gen` 加入宽屏白名单(去 600px 限宽),页面占满屏幕宽度
|
||||||
|
- 布局改为占满可视高度:左侧控制面板(模型/提示词/示例/宽高比/生成) + 右侧大结果区填满剩余空间
|
||||||
|
- 工具描述同步改为「AI 文生图」
|
||||||
|
- 验证:无模式 tab/上传框、maxWidth=none、body 1293×780、结果区 857×780 占满 ✓
|
||||||
|
|
||||||
|
|
||||||
### 💻 IT最新技术换权威源(IT之家)
|
### 💻 IT最新技术换权威源(IT之家)
|
||||||
- 「IT最新技术」数据源 Hacker News(社区内容、无简介)→ **IT之家**(权威中文 IT 资讯,60 条带中文简介)
|
- 「IT最新技术」数据源 Hacker News(社区内容、无简介)→ **IT之家**(权威中文 IT 资讯,60 条带中文简介)
|
||||||
- 中文源免翻译免代理,标题+简介原生中文;简介自动去「IT之家X月X日消息」套话再截 20 字
|
- 中文源免翻译免代理,标题+简介原生中文;简介自动去「IT之家X月X日消息」套话再截 20 字
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ useHead(head);
|
|||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
// 宽屏工具:不受 600px 限宽,占满可用宽度(画布/多栏类工具)
|
// 宽屏工具:不受 600px 限宽,占满可用宽度(画布/多栏类工具)
|
||||||
const WIDE_TOOLS = new Set(['/label-designer', '/json-prettify', '/pdf-tools', '/image-tools', '/doc-convert', '/video-tools', '/seal-maker', '/signature-pad', '/ai-image-lab', '/ai-chat', '/copywriting']);
|
const WIDE_TOOLS = new Set(['/label-designer', '/json-prettify', '/pdf-tools', '/image-tools', '/doc-convert', '/video-tools', '/seal-maker', '/signature-pad', '/ai-image-lab', '/ai-chat', '/copywriting', '/ai-gen']);
|
||||||
const isWide = computed(() => WIDE_TOOLS.has(route.path));
|
const isWide = computed(() => WIDE_TOOLS.has(route.path));
|
||||||
|
|
||||||
const i18nKey = computed<string>(() => route.path.trim().replace('/', ''));
|
const i18nKey = computed<string>(() => route.path.trim().replace('/', ''));
|
||||||
|
|||||||
+58
-189
@@ -1,9 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getMachineId, licenseHeaders } from '@/tools/license/license';
|
import { getMachineId, licenseHeaders } from '@/tools/license/license';
|
||||||
|
|
||||||
type Mode = 'txt' | 'img';
|
|
||||||
|
|
||||||
const mode = ref<Mode>('txt');
|
|
||||||
const models = ref<{ id: string; i2i: boolean }[]>([]);
|
const models = ref<{ id: string; i2i: boolean }[]>([]);
|
||||||
const model = ref('pollinations-flux');
|
const model = ref('pollinations-flux');
|
||||||
const prompt = ref('');
|
const prompt = ref('');
|
||||||
@@ -11,10 +8,6 @@ const loading = ref(false);
|
|||||||
const error = ref('');
|
const error = ref('');
|
||||||
const resultUrl = ref('');
|
const resultUrl = ref('');
|
||||||
|
|
||||||
// 图生图:源图(dataURL)
|
|
||||||
const srcData = ref('');
|
|
||||||
const srcInput = ref<HTMLInputElement>();
|
|
||||||
|
|
||||||
// 宽高比
|
// 宽高比
|
||||||
type Ratio = { label: string; w: number; h: number; sw: number; sh: number };
|
type Ratio = { label: string; w: number; h: number; sw: number; sh: number };
|
||||||
const RATIOS: Ratio[] = [
|
const RATIOS: Ratio[] = [
|
||||||
@@ -42,12 +35,7 @@ const EXAMPLES = [
|
|||||||
{ n: '油画风格', p: '油画风格,厚涂笔触,丰富色彩,印象派,艺术感,画布质感' },
|
{ n: '油画风格', p: '油画风格,厚涂笔触,丰富色彩,印象派,艺术感,画布质感' },
|
||||||
];
|
];
|
||||||
|
|
||||||
const currentModel = computed(() => models.value.find(m => m.id === model.value));
|
const canGen = computed(() => !!prompt.value.trim());
|
||||||
const canGen = computed(() => {
|
|
||||||
if (!prompt.value.trim()) return false;
|
|
||||||
if (mode.value === 'img' && !srcData.value) return false;
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
@@ -65,26 +53,6 @@ onMounted(async () => {
|
|||||||
catch { /* 模型列表加载失败则用默认 */ }
|
catch { /* 模型列表加载失败则用默认 */ }
|
||||||
});
|
});
|
||||||
|
|
||||||
function pickSrc() {
|
|
||||||
srcInput.value?.click();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onSrc(e: Event) {
|
|
||||||
const input = e.target as HTMLInputElement;
|
|
||||||
const f = input.files?.[0];
|
|
||||||
input.value = '';
|
|
||||||
if (!f) return;
|
|
||||||
if (f.size > 10 * 1024 * 1024) {
|
|
||||||
error.value = '图片超过 10MB,请压缩后再上传';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const rd = new FileReader();
|
|
||||||
rd.onload = () => {
|
|
||||||
srcData.value = String(rd.result || '');
|
|
||||||
};
|
|
||||||
rd.readAsDataURL(f);
|
|
||||||
}
|
|
||||||
|
|
||||||
function b64DataUrl(b64: string) {
|
function b64DataUrl(b64: string) {
|
||||||
let mime = 'image/png';
|
let mime = 'image/png';
|
||||||
if (b64.startsWith('/9j/')) mime = 'image/jpeg';
|
if (b64.startsWith('/9j/')) mime = 'image/jpeg';
|
||||||
@@ -98,38 +66,21 @@ async function generate() {
|
|||||||
error.value = '';
|
error.value = '';
|
||||||
resultUrl.value = '';
|
resultUrl.value = '';
|
||||||
try {
|
try {
|
||||||
if (mode.value === 'txt') {
|
const r = ratioObj.value;
|
||||||
const r = ratioObj.value;
|
const res = await fetch('/relay/ai/gen-image', {
|
||||||
const res = await fetch('/relay/ai/gen-image', {
|
method: 'POST',
|
||||||
method: 'POST',
|
headers: { 'Content-Type': 'application/json', ...licenseHeaders('ai-gen') },
|
||||||
headers: { 'Content-Type': 'application/json', ...licenseHeaders('ai-gen') },
|
body: JSON.stringify({
|
||||||
body: JSON.stringify({
|
machine: getMachineId(),
|
||||||
machine: getMachineId(),
|
prompt: prompt.value.trim(),
|
||||||
prompt: prompt.value.trim(),
|
model: model.value,
|
||||||
model: model.value,
|
width: r.w,
|
||||||
width: r.w,
|
height: r.h,
|
||||||
height: r.h,
|
}),
|
||||||
}),
|
});
|
||||||
});
|
const j = await res.json().catch(() => ({}));
|
||||||
const j = await res.json().catch(() => ({}));
|
if (!res.ok || j.code !== 200) throw new Error(j.message || `HTTP ${res.status}`);
|
||||||
if (!res.ok || j.code !== 200) throw new Error(j.message || `HTTP ${res.status}`);
|
resultUrl.value = j.data.b64 ? b64DataUrl(j.data.b64) : j.data.url;
|
||||||
resultUrl.value = j.data.b64 ? b64DataUrl(j.data.b64) : j.data.url;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
const blob = await (await fetch(srcData.value)).blob();
|
|
||||||
const fd = new FormData();
|
|
||||||
fd.append('image', blob, 'src.png');
|
|
||||||
fd.append('prompt', prompt.value.trim());
|
|
||||||
fd.append('model', model.value);
|
|
||||||
const res = await fetch('/relay/ai/edit-image', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: licenseHeaders('ai-gen'),
|
|
||||||
body: fd,
|
|
||||||
});
|
|
||||||
const j = await res.json().catch(() => ({}));
|
|
||||||
if (!res.ok || j.code !== 200) throw new Error(j.message || `HTTP ${res.status}`);
|
|
||||||
resultUrl.value = j.data.b64 ? b64DataUrl(j.data.b64) : j.data.url;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (e: any) {
|
catch (e: any) {
|
||||||
error.value = String(e?.message || e);
|
error.value = String(e?.message || e);
|
||||||
@@ -142,22 +93,14 @@ async function generate() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="gen-root">
|
<div class="gen-root">
|
||||||
<!-- 模式切换 -->
|
|
||||||
<div class="gen-modes">
|
|
||||||
<button class="gen-mode" :class="{ on: mode === 'txt' }" @click="mode = 'txt'">✏️ 文生图</button>
|
|
||||||
<button class="gen-mode" :class="{ on: mode === 'img' }" @click="mode = 'img'">🖼️ 图生图</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="gen-body">
|
<div class="gen-body">
|
||||||
<!-- 左侧控制 -->
|
<!-- 左侧控制面板 -->
|
||||||
<div class="gen-ctrl">
|
<div class="gen-ctrl">
|
||||||
<!-- 模型 -->
|
<!-- 模型 -->
|
||||||
<div class="gen-sec">
|
<div class="gen-sec">
|
||||||
<div class="gen-h">模型</div>
|
<div class="gen-h">模型</div>
|
||||||
<select v-model="model" class="gen-model-sel">
|
<select v-model="model" class="gen-model-sel">
|
||||||
<option v-for="m in models" :key="m.id" :value="m.id">
|
<option v-for="m in models" :key="m.id" :value="m.id">{{ m.id }}</option>
|
||||||
{{ m.id }}{{ m.i2i ? '' : ' · 仅文生图' }}
|
|
||||||
</option>
|
|
||||||
<option v-if="!models.length" value="pollinations-flux">pollinations-flux</option>
|
<option v-if="!models.length" value="pollinations-flux">pollinations-flux</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="gen-pills">
|
<div class="gen-pills">
|
||||||
@@ -166,7 +109,6 @@ async function generate() {
|
|||||||
:key="m.id"
|
:key="m.id"
|
||||||
class="gen-pill"
|
class="gen-pill"
|
||||||
:class="{ on: model === m.id }"
|
:class="{ on: model === m.id }"
|
||||||
:title="m.i2i ? '支持图生图' : '仅文生图'"
|
|
||||||
@click="model = m.id"
|
@click="model = m.id"
|
||||||
>
|
>
|
||||||
{{ m.id }}
|
{{ m.id }}
|
||||||
@@ -174,29 +116,14 @@ async function generate() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 图生图:源图上传 -->
|
|
||||||
<div v-if="mode === 'img'" class="gen-sec">
|
|
||||||
<div class="gen-h">原图</div>
|
|
||||||
<input ref="srcInput" type="file" hidden accept="image/*" @change="onSrc">
|
|
||||||
<div class="gen-upload" @click="pickSrc">
|
|
||||||
<template v-if="!srcData">
|
|
||||||
📁 点击上传图片<br><span>JPG / PNG / WEBP · ≤10MB</span>
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<img class="gen-thumb" :src="srcData" alt="">
|
|
||||||
<a href="javascript:;" class="gen-clear" @click.stop="srcData = ''">✕</a>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 提示词 -->
|
<!-- 提示词 -->
|
||||||
<div class="gen-sec">
|
<div class="gen-sec gen-grow">
|
||||||
<div class="gen-h">提示词</div>
|
<div class="gen-h">提示词</div>
|
||||||
<textarea
|
<textarea
|
||||||
v-model="prompt"
|
v-model="prompt"
|
||||||
class="gen-prompt"
|
class="gen-prompt"
|
||||||
maxlength="1000"
|
maxlength="1000"
|
||||||
placeholder="描述你想生成的图像,例如:将背景更改为蓝天 / 一只戴帽子的柴犬,卡通风格"
|
placeholder="描述你想生成的图像,例如:一只戴帽子的柴犬,卡通风格,可爱 / 赛博朋克城市夜景,霓虹灯"
|
||||||
/>
|
/>
|
||||||
<div class="gen-count">{{ prompt.length }}/1000</div>
|
<div class="gen-count">{{ prompt.length }}/1000</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -209,8 +136,8 @@ async function generate() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 宽高比(仅文生图) -->
|
<!-- 宽高比 -->
|
||||||
<div v-if="mode === 'txt'" class="gen-sec">
|
<div class="gen-sec">
|
||||||
<div class="gen-h">宽高比</div>
|
<div class="gen-h">宽高比</div>
|
||||||
<div class="gen-ratios">
|
<div class="gen-ratios">
|
||||||
<button
|
<button
|
||||||
@@ -230,12 +157,9 @@ async function generate() {
|
|||||||
{{ loading ? '⏳ 生成中…' : '🎨 生成图片' }}
|
{{ loading ? '⏳ 生成中…' : '🎨 生成图片' }}
|
||||||
</button>
|
</button>
|
||||||
<div v-if="error" class="gen-err">⚠️ {{ error }}</div>
|
<div v-if="error" class="gen-err">⚠️ {{ error }}</div>
|
||||||
<div v-if="mode === 'img' && !currentModel?.i2i && models.length" class="gen-hint">
|
|
||||||
提示:当前模型偏文生图,图生图建议选 dall-e / flux 系列。
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 右侧结果 -->
|
<!-- 右侧结果(占满剩余空间) -->
|
||||||
<div class="gen-result">
|
<div class="gen-result">
|
||||||
<div v-if="resultUrl" class="gen-img-box">
|
<div v-if="resultUrl" class="gen-img-box">
|
||||||
<img :src="resultUrl" alt="生成结果">
|
<img :src="resultUrl" alt="生成结果">
|
||||||
@@ -258,43 +182,23 @@ async function generate() {
|
|||||||
.gen-root {
|
.gen-root {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gen-modes {
|
|
||||||
display: flex;
|
|
||||||
gap: 8px;
|
|
||||||
|
|
||||||
.gen-mode {
|
|
||||||
padding: 8px 18px;
|
|
||||||
border-radius: 9px;
|
|
||||||
border: 1px solid rgba(128, 128, 128, 0.3);
|
|
||||||
background: #fff;
|
|
||||||
font-size: 14px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.15s;
|
|
||||||
|
|
||||||
&.on {
|
|
||||||
background: #0ea5a0;
|
|
||||||
border-color: #0ea5a0;
|
|
||||||
color: #fff;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 占满屏幕:控制面板 + 结果区填满可视高度
|
||||||
.gen-body {
|
.gen-body {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
align-items: flex-start;
|
align-items: stretch;
|
||||||
|
min-height: calc(100vh - 170px);
|
||||||
|
|
||||||
@media (max-width: 900px) {
|
@media (max-width: 900px) {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
min-height: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.gen-ctrl {
|
.gen-ctrl {
|
||||||
width: 380px;
|
width: 420px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -311,16 +215,21 @@ async function generate() {
|
|||||||
gap: 7px;
|
gap: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.gen-grow {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.gen-h {
|
.gen-h {
|
||||||
font-size: 13px;
|
font-size: 14px;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gen-model-sel {
|
.gen-model-sel {
|
||||||
padding: 8px 10px;
|
padding: 9px 10px;
|
||||||
border: 1px solid rgba(128, 128, 128, 0.3);
|
border: 1px solid rgba(128, 128, 128, 0.3);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
font-size: 13px;
|
font-size: 13.5px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
@@ -352,52 +261,16 @@ async function generate() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.gen-upload {
|
|
||||||
position: relative;
|
|
||||||
border: 2px dashed rgba(14, 165, 160, 0.5);
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 18px;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 13px;
|
|
||||||
cursor: pointer;
|
|
||||||
color: #0e8b87;
|
|
||||||
background: rgba(14, 165, 160, 0.04);
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
span {
|
|
||||||
display: block;
|
|
||||||
font-size: 11.5px;
|
|
||||||
opacity: 0.6;
|
|
||||||
margin-top: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gen-thumb {
|
|
||||||
max-width: 100%;
|
|
||||||
max-height: 180px;
|
|
||||||
border-radius: 8px;
|
|
||||||
display: block;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gen-clear {
|
|
||||||
position: absolute;
|
|
||||||
top: 6px;
|
|
||||||
right: 8px;
|
|
||||||
color: #d03050;
|
|
||||||
font-weight: 700;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.gen-prompt {
|
.gen-prompt {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 96px;
|
flex: 1;
|
||||||
|
min-height: 150px;
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
padding: 10px 12px;
|
padding: 12px 14px;
|
||||||
border: 1px solid rgba(128, 128, 128, 0.3);
|
border: 1px solid rgba(128, 128, 128, 0.3);
|
||||||
border-radius: 9px;
|
border-radius: 10px;
|
||||||
font-size: 13.5px;
|
font-size: 15px;
|
||||||
line-height: 1.6;
|
line-height: 1.7;
|
||||||
outline: none;
|
outline: none;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
@@ -419,11 +292,11 @@ async function generate() {
|
|||||||
gap: 6px;
|
gap: 6px;
|
||||||
|
|
||||||
.gen-example {
|
.gen-example {
|
||||||
padding: 6px 12px;
|
padding: 7px 13px;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
border: 1px solid rgba(128, 128, 128, 0.28);
|
border: 1px solid rgba(128, 128, 128, 0.28);
|
||||||
background: #fff;
|
background: #fff;
|
||||||
font-size: 12.5px;
|
font-size: 13px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.15s;
|
transition: all 0.15s;
|
||||||
|
|
||||||
@@ -444,7 +317,7 @@ async function generate() {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
padding: 9px 4px;
|
padding: 10px 4px;
|
||||||
border: 1px solid rgba(128, 128, 128, 0.28);
|
border: 1px solid rgba(128, 128, 128, 0.28);
|
||||||
border-radius: 9px;
|
border-radius: 9px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
@@ -463,19 +336,19 @@ async function generate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.gen-rl {
|
.gen-rl {
|
||||||
font-size: 11px;
|
font-size: 11.5px;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.gen-go {
|
.gen-go {
|
||||||
padding: 12px;
|
padding: 14px;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
background: linear-gradient(48deg, #0e9384, #14b8a6);
|
background: linear-gradient(48deg, #0e9384, #14b8a6);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 15px;
|
font-size: 16px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: opacity 0.15s;
|
transition: opacity 0.15s;
|
||||||
@@ -487,39 +360,35 @@ async function generate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.gen-err {
|
.gen-err {
|
||||||
font-size: 12.5px;
|
font-size: 13px;
|
||||||
color: #d03050;
|
color: #d03050;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gen-hint {
|
// 结果区:占满剩余宽度与全部高度
|
||||||
font-size: 12px;
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gen-result {
|
.gen-result {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
min-height: 420px;
|
|
||||||
border: 1px solid rgba(128, 128, 128, 0.25);
|
border: 1px solid rgba(128, 128, 128, 0.25);
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
background: rgba(128, 128, 128, 0.04);
|
background: rgba(128, 128, 128, 0.04);
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 16px;
|
padding: 20px;
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gen-img-box {
|
.gen-img-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 14px;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
max-height: 60vh;
|
max-height: calc(100vh - 320px);
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
|
||||||
}
|
}
|
||||||
@@ -530,11 +399,11 @@ async function generate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.gen-dl {
|
.gen-dl {
|
||||||
padding: 8px 16px;
|
padding: 9px 18px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
background: rgba(14, 165, 160, 0.12);
|
background: rgba(14, 165, 160, 0.12);
|
||||||
color: #0e8b87;
|
color: #0e8b87;
|
||||||
font-size: 13px;
|
font-size: 14px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
@@ -543,10 +412,10 @@ async function generate() {
|
|||||||
.gen-empty {
|
.gen-empty {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
font-size: 13.5px;
|
font-size: 14.5px;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
margin-top: 12px;
|
margin-top: 14px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -4,8 +4,8 @@ import { defineTool } from '../tool';
|
|||||||
export const tool = defineTool({
|
export const tool = defineTool({
|
||||||
name: 'AI 生图',
|
name: 'AI 生图',
|
||||||
path: '/ai-gen',
|
path: '/ai-gen',
|
||||||
description: 'AI 文生图与图生图:多模型选择、宽高比、示例提示词,一键生成图片',
|
description: 'AI 文生图:多模型选择、宽高比、示例提示词,一键生成图片',
|
||||||
keywords: ['ai', 'image', 'generate', '生图', '文生图', '图生图', 'ai绘画', 'ai图片', '生成图片', '绘图'],
|
keywords: ['ai', 'image', 'generate', '生图', '文生图', 'ai绘画', 'ai图片', '生成图片', '绘图'],
|
||||||
component: () => import('./ai-gen.vue'),
|
component: () => import('./ai-gen.vue'),
|
||||||
icon: Photo,
|
icon: Photo,
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user