mirror of
https://github.com/openai/codex.git
synced 2026-11-17 14:58:36 +00:00
Centralize prompt image detail modes (#42624)
## What changed - Add `PromptImageMode::HIGH_DETAIL` and `PromptImageMode::ORIGINAL_DETAIL` constants with the standard resize limits. - Use the shared modes during core image preparation instead of defining the limits locally. - Cover the dimension and patch budgets for both detail modes in the image utility tests. GitOrigin-RevId: 27fdc77719f23d2e8f1060886576b3be843a8491
This commit is contained in:
1 parent
781c183c3b
commit
280ae8b9fc
3 files changed
+53
-38
No files matched your search
@@ -70,6 +70,19 @@ pub struct PromptImageResizeLimits {
|
||||
pub max_patches: usize,
|
||||
}
|
||||
|
||||
impl PromptImageMode {
|
||||
/// Resize policy for high-detail prompt images.
|
||||
pub const HIGH_DETAIL: Self = Self::ResizeWithLimits(PromptImageResizeLimits {
|
||||
max_dimension: 2048,
|
||||
max_patches: 2_500,
|
||||
});
|
||||
/// Resize policy for original-detail prompt images.
|
||||
pub const ORIGINAL_DETAIL: Self = Self::ResizeWithLimits(PromptImageResizeLimits {
|
||||
max_dimension: 6000,
|
||||
max_patches: 10_000,
|
||||
});
|
||||
}
|
||||
|
||||
struct ImageMetadata {
|
||||
icc_profile: Option<Vec<u8>>,
|
||||
exif: Option<Vec<u8>>,
|
||||
|
||||
Reference in new issue
Block a user