mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-10 20:11:49 +00:00
strum wip
This commit is contained in:
1 parent
c001085a15
commit
bde8975d04
10 files changed
+15
-31
No files matched your search
@@ -22,19 +22,13 @@ workspace-build-acceleration.workspace = true
|
||||
# Internal
|
||||
enums_shared.workspace = true
|
||||
|
||||
# Serialization
|
||||
# External
|
||||
log.workspace = true
|
||||
serde.workspace = true
|
||||
serde_derive.workspace = true
|
||||
|
||||
# API documentation
|
||||
strum.workspace = true
|
||||
utoipa.workspace = true
|
||||
|
||||
log.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
# Enum utilities
|
||||
strum.workspace = true
|
||||
|
||||
# Test serialization
|
||||
serde_json.workspace = true
|
||||
toml.workspace = true
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
use strum::EnumIter;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
/// Report certain jobs publicly as different from what we actually run.
|
||||
@@ -5,7 +6,7 @@ use utoipa::ToSchema;
|
||||
/// the same models or workflows.
|
||||
///
|
||||
/// Previously named `PublicInferenceJobType` in the `enums_public` crate.
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize, Default, ToSchema, Debug)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize, Default, ToSchema, Debug, EnumIter)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum InferenceJobType {
|
||||
// ======= Renamed enum variants ======
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
use strum::EnumIter;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
/// Report certain models publicly as different from what we actually use.
|
||||
@@ -7,7 +8,7 @@ use utoipa::ToSchema;
|
||||
/// the same models. This won't always make sense, but in some cases it will.
|
||||
///
|
||||
/// This was previously named `PublicMediaFileModelType` in the `enums_public` crate.
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize, ToSchema, Debug)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize, ToSchema, Debug, EnumIter)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum MediaFileOriginModelType {
|
||||
// Renamed enum variants
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
use strum::EnumIter;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
/// Report certain models publicly as different from what we actually use.
|
||||
///
|
||||
/// Previously named `PublicWeightsType` in the `enums_public` crate.
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize, ToSchema, Debug)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize, ToSchema, Debug, EnumIter)]
|
||||
pub enum WeightsType {
|
||||
// Renamed enum variants
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#[cfg(test)]
|
||||
use strum::EnumIter;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
/// Common aspect ratios for video generation.
|
||||
/// Mirrors artcraft_router::api::common_aspect_ratio::CommonAspectRatio.
|
||||
#[cfg_attr(test, derive(EnumIter))]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, ToSchema, EnumIter)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum CommonAspectRatio {
|
||||
Auto,
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#[cfg(test)]
|
||||
use strum::EnumIter;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
/// Image models available for generation.
|
||||
/// Mirrors artcraft_router::api::common_image_model::CommonImageModel.
|
||||
#[cfg_attr(test, derive(EnumIter))]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, ToSchema, EnumIter)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum CommonImageModel {
|
||||
#[serde(rename = "flux_1_dev")]
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#[cfg(test)]
|
||||
use strum::EnumIter;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
/// Splat models available for generation.
|
||||
/// Mirrors artcraft_router::api::common_splat_model::CommonSplatModel.
|
||||
#[cfg_attr(test, derive(EnumIter))]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, ToSchema, EnumIter)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum CommonSplatModel {
|
||||
#[serde(rename = "marble_0p1_mini")]
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#[cfg(test)]
|
||||
use strum::EnumIter;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
/// Video models available for generation.
|
||||
/// Mirrors artcraft_router::api::common_video_model::CommonVideoModel.
|
||||
#[cfg_attr(test, derive(EnumIter))]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, ToSchema, EnumIter)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum CommonVideoModel {
|
||||
#[serde(rename = "grok_video")]
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#[cfg(test)]
|
||||
use strum::EnumIter;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
/// Common video resolutions.
|
||||
/// Mirrors artcraft_router::api::common_resolution::CommonResolution.
|
||||
#[cfg_attr(test, derive(EnumIter))]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, ToSchema, EnumIter)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum CommonVideoResolution {
|
||||
OneK,
|
||||
|
||||
@@ -5,15 +5,12 @@
|
||||
//!
|
||||
//! Do not change the values here without cause or care.
|
||||
|
||||
#[cfg(test)]
|
||||
use strum::EnumCount;
|
||||
#[cfg(test)]
|
||||
use strum::EnumIter;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
/// NB: Keep the max length to 16 characters.
|
||||
#[cfg_attr(test, derive(EnumIter, EnumCount))]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Ord, PartialOrd, Serialize, Deserialize, ToSchema)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Ord, PartialOrd, Serialize, Deserialize, ToSchema, EnumIter, EnumCount)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum GenerationProvider {
|
||||
Artcraft,
|
||||
|
||||
Reference in new issue
Block a user