fix: default replicate previews to portrait ratio
This commit is contained in:
@@ -34,6 +34,10 @@ function projectTitle(session: GenSession) {
|
||||
return session.characterSpec?.name || session.prompt || '未命名项目';
|
||||
}
|
||||
|
||||
function defaultPrimaryAspectRatio(session: GenSession) {
|
||||
return session.inputMode === 'replicate' || session.inputMode === 'extend' ? '2 / 3' : '1 / 1';
|
||||
}
|
||||
|
||||
function imageSourcesForSession(session: GenSession) {
|
||||
const uploaded = session.uploadedImages?.map(image => ({
|
||||
url: image.url,
|
||||
@@ -90,11 +94,11 @@ function ProjectBrief({ session }: { session: GenSession }) {
|
||||
const generatedAssets = (session.packs ?? []).reduce((sum, pack) => sum + pack.assets.length, 0);
|
||||
const totalSlots = packSlotTotal();
|
||||
const [previewOpen, setPreviewOpen] = useState(false);
|
||||
const [primaryAspectRatio, setPrimaryAspectRatio] = useState('1 / 1');
|
||||
const [primaryAspectRatio, setPrimaryAspectRatio] = useState(defaultPrimaryAspectRatio(session));
|
||||
|
||||
useEffect(() => {
|
||||
setPrimaryAspectRatio('1 / 1');
|
||||
}, [primaryImage?.url]);
|
||||
setPrimaryAspectRatio(defaultPrimaryAspectRatio(session));
|
||||
}, [primaryImage?.url, session.inputMode]);
|
||||
|
||||
return (
|
||||
<section className="project-brief-panel">
|
||||
|
||||
Reference in New Issue
Block a user