修复分辨率
This commit is contained in:
@@ -2644,13 +2644,14 @@ func guessRatio(w, h int) string {
|
|||||||
W int
|
W int
|
||||||
H int
|
H int
|
||||||
}
|
}
|
||||||
// The 14 ratios actually used across our models. Must stay in sync with the
|
// The 13 ratios actually used across our models. Must stay in sync with the
|
||||||
// custom-model picker (CustomModelModal RATIO_OPTS) and the docs 对照表, so a
|
// custom-model picker (CustomModelModal RATIO_OPTS) and the docs 对照表, so a
|
||||||
// /v1 `size` maps to exactly one of them.
|
// /v1 `size` maps to exactly one of them. 9:21 is intentionally absent —
|
||||||
|
// no image provider accepts it (Runway 400s on it).
|
||||||
candidates := []candidate{
|
candidates := []candidate{
|
||||||
{1, 1},
|
{1, 1},
|
||||||
{5, 4}, {4, 3}, {3, 2}, {16, 9}, {2, 1}, {21, 9}, {3, 1}, // 横
|
{5, 4}, {4, 3}, {3, 2}, {16, 9}, {2, 1}, {21, 9}, {3, 1}, // 横
|
||||||
{4, 5}, {3, 4}, {2, 3}, {9, 16}, {9, 21}, {1, 3}, // 竖
|
{4, 5}, {3, 4}, {2, 3}, {9, 16}, {1, 3}, // 竖
|
||||||
}
|
}
|
||||||
best := candidates[0]
|
best := candidates[0]
|
||||||
bestDelta := absFloat(float64(w)/float64(h) - float64(best.W)/float64(best.H))
|
bestDelta := absFloat(float64(w)/float64(h) - float64(best.W)/float64(best.H))
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import SelectMenu from './SelectMenu.vue'
|
|||||||
|
|
||||||
const emit = defineEmits(['close', 'saved'])
|
const emit = defineEmits(['close', 'saved'])
|
||||||
|
|
||||||
// 14 ratios — the union of what our models actually support; kept in sync with
|
// 13 ratios — the union of what our models actually support; kept in sync with
|
||||||
// the backend guessRatio() and the docs 对照表.
|
// the backend guessRatio() and the docs 对照表. 9:21 removed (no image provider accepts it).
|
||||||
const RATIO_OPTS = ['1:1', '5:4', '4:3', '3:2', '16:9', '2:1', '21:9', '3:1', '4:5', '3:4', '2:3', '9:16', '9:21', '1:3']
|
const RATIO_OPTS = ['1:1', '5:4', '4:3', '3:2', '16:9', '2:1', '21:9', '3:1', '4:5', '3:4', '2:3', '9:16', '1:3']
|
||||||
const IMG_RES = ['1K', '2K', '4K']
|
const IMG_RES = ['1K', '2K', '4K']
|
||||||
const VID_RES = ['720p', '1080p', '2K', '4K']
|
const VID_RES = ['720p', '1080p', '2K', '4K']
|
||||||
const ALL_RES = ['1K', '2K', '4K', '720p', '1080p']
|
const ALL_RES = ['1K', '2K', '4K', '720p', '1080p']
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ const sizeTable = [
|
|||||||
{ ratio: '3:4 · 竖', k1: '768x1024', k2: '1536x2048', k4: '3072x4096' },
|
{ ratio: '3:4 · 竖', k1: '768x1024', k2: '1536x2048', k4: '3072x4096' },
|
||||||
{ ratio: '2:3 · 竖', k1: '800x1200', k2: '1600x2400', k4: '2400x3600' },
|
{ ratio: '2:3 · 竖', k1: '800x1200', k2: '1600x2400', k4: '2400x3600' },
|
||||||
{ ratio: '9:16 · 竖', k1: '720x1280', k2: '1152x2048', k4: '2304x4096' },
|
{ ratio: '9:16 · 竖', k1: '720x1280', k2: '1152x2048', k4: '2304x4096' },
|
||||||
{ ratio: '9:21 · 竖超宽', k1: '720x1680', k2: '1080x2520', k4: '2160x5040' },
|
|
||||||
{ ratio: '1:3 · 竖', k1: '512x1536', k2: '768x2304', k4: '1280x3840' },
|
{ ratio: '1:3 · 竖', k1: '512x1536', k2: '768x2304', k4: '1280x3840' },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user