Use bundled Linux Do picture templates
This commit is contained in:
@@ -105,51 +105,6 @@ const STYLE_PRESETS = [
|
||||
prompt: 'modern Chinese illustration style, elegant linework, vivid but balanced colors, poster composition',
|
||||
},
|
||||
];
|
||||
const FALLBACK_TEMPLATES: PromptTemplate[] = [
|
||||
{
|
||||
id: 'local-product-glass-robot',
|
||||
title: '玻璃机器人产品照',
|
||||
tag: '商业',
|
||||
size: '1024x1024',
|
||||
prompt: 'A precise editorial product photo of a translucent glass robot painting a small neon city, sharp focus, clean background, controlled studio lighting, premium advertising composition, ultra detailed',
|
||||
},
|
||||
{
|
||||
id: 'local-hanfu-cat-golden-hour',
|
||||
title: '汉服与白猫',
|
||||
tag: '国风',
|
||||
size: '1024x1536',
|
||||
prompt: 'A breathtakingly beautiful ancient Chinese woman in flowing jade-green and blush pink hanfu, golden peony embroidery, sitting by a moon-shaped window in warm afternoon sunlight, gently teasing a fluffy white cat with a silk tassel, celadon tea set and ink calligraphy nearby, serene romantic dreamlike Song Dynasty aesthetics, cinematic depth of field, ultra detailed digital art',
|
||||
},
|
||||
{
|
||||
id: 'local-cyberpunk-street',
|
||||
title: '赛博街景海报',
|
||||
tag: '海报',
|
||||
size: '1536x1024',
|
||||
prompt: 'A cinematic cyberpunk street market after rain, neon signs reflected on wet pavement, a courier in a translucent raincoat walking through steam, layered storefronts and holographic menus, dramatic teal and amber lighting, editorial poster composition, high detail',
|
||||
},
|
||||
{
|
||||
id: 'local-character-turnaround',
|
||||
title: '角色四视图',
|
||||
tag: '角色',
|
||||
size: '1536x1024',
|
||||
prompt: 'Character design sheet, same original fantasy explorer shown in front view, side view, back view and three-quarter view, consistent outfit and proportions, clean light background, readable silhouette, detailed fabric and accessories, professional concept art',
|
||||
},
|
||||
{
|
||||
id: 'local-food-photography',
|
||||
title: '高级餐饮摄影',
|
||||
tag: '商业',
|
||||
size: '1024x1024',
|
||||
prompt: 'Premium food photography of a porcelain bowl of hand-pulled noodles with chili oil, scallions and steam, dark stone tabletop, soft side lighting, shallow depth of field, appetizing texture, refined restaurant campaign style',
|
||||
},
|
||||
{
|
||||
id: 'local-tea-room',
|
||||
title: '现代茶室空间',
|
||||
tag: '空间',
|
||||
size: '1536x1024',
|
||||
prompt: 'A quiet contemporary Chinese tea room interior with warm timber lattice, low stone tea table, linen cushions, bamboo courtyard visible through sliding doors, natural morning light, calm luxury hospitality design, realistic architectural visualization',
|
||||
},
|
||||
];
|
||||
|
||||
function makeId() {
|
||||
if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {
|
||||
return crypto.randomUUID();
|
||||
@@ -430,9 +385,9 @@ export default function PictureAgent() {
|
||||
keyName: '加载密钥中',
|
||||
});
|
||||
setModel((current) => current || 'gpt-image-2');
|
||||
setTemplates(FALLBACK_TEMPLATES);
|
||||
setTemplates([]);
|
||||
setTemplatesError('');
|
||||
setTemplatesLoading(false);
|
||||
setTemplatesLoading(true);
|
||||
try {
|
||||
const [statusResult, modelsResult, jobsResult] = await Promise.allSettled([
|
||||
authedFetch('/api/picture-agent/status', { timeoutMs: 8_000 }),
|
||||
@@ -484,7 +439,6 @@ export default function PictureAgent() {
|
||||
}
|
||||
|
||||
try {
|
||||
if (!ignore) setTemplatesLoading(true);
|
||||
const templatesRes = await authedFetch(`/api/picture-agent/templates?limit=${TEMPLATE_LIMIT}`, { timeoutMs: 10_000 });
|
||||
if (ignore) return;
|
||||
if (!templatesRes.ok) {
|
||||
@@ -928,10 +882,10 @@ export default function PictureAgent() {
|
||||
{templatesLoading && templates.length === 0
|
||||
? '正在加载参考模板...'
|
||||
: templatesLoading
|
||||
? '本地模板可用,正在后台补充图库'
|
||||
? '正在读取本地 Linux Do 模板库'
|
||||
: templatesError
|
||||
? '远程图库暂不可用,已使用本地模板'
|
||||
: '来自 Linux Do GPT Image Gallery'}
|
||||
? '本地模板库加载失败'
|
||||
: '来自本地 Linux Do GPT Image Gallery'}
|
||||
</span>
|
||||
</div>
|
||||
<div className="picture-agent-template-list">
|
||||
|
||||
Reference in New Issue
Block a user