mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 17:38:10 +00:00
properties added
This commit is contained in:
1 parent
dbe989c5a1
commit
1614cba2f8
2 files changed
+36
-5
No files matched your search
+27
-4
@@ -20,9 +20,6 @@ pub enum StableDiffusionSource {
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq)]
|
||||
pub struct StableDiffusionArgs {
|
||||
#[serde(rename = "is")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_image_source: Option<MediaFileToken>,
|
||||
|
||||
#[serde(rename = "sd")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
@@ -32,6 +29,18 @@ pub struct StableDiffusionArgs {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_lora_model_token: Option<ModelWeightToken>,
|
||||
|
||||
#[serde(rename = "w")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_width: Option<i32>,
|
||||
|
||||
#[serde(rename = "h")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_height: Option<i32>,
|
||||
|
||||
#[serde(rename = "s")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_sampler: Option<i32>,
|
||||
|
||||
#[serde(rename = "p")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_prompt: Option<String>,
|
||||
@@ -51,13 +60,27 @@ pub struct StableDiffusionArgs {
|
||||
#[serde(rename = "mu")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_upload_path: Option<String>,
|
||||
|
||||
#[serde(rename = "cf")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_cfg_scale: Option<i32>,
|
||||
|
||||
#[serde(rename = "lu")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_lora_upload_path: Option<String>,
|
||||
|
||||
#[serde(rename = "sa")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_number_of_samples: Option<i64>,
|
||||
|
||||
#[serde(rename = "bz")]
|
||||
pub maybe_batch_size: Option<i32>,
|
||||
|
||||
#[serde(rename = "bc")]
|
||||
pub maybe_batch_count: Option<i32>,
|
||||
|
||||
#[serde(rename = "t")]
|
||||
pub inference_type: String,
|
||||
pub type_of_inference: String,
|
||||
}
|
||||
|
||||
|
||||
+9
-1
@@ -67,6 +67,7 @@ impl Display for TypeOfInference {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#[derive(Deserialize,ToSchema)]
|
||||
pub struct EnqueueImageGenRequest {
|
||||
uuid_idempotency_token: String,
|
||||
@@ -78,9 +79,15 @@ pub struct EnqueueImageGenRequest {
|
||||
maybe_a_prompt: Option<String>,
|
||||
maybe_n_prompt: Option<String>,
|
||||
maybe_seed: Option<i64>,
|
||||
maybe_width: Option<i32>,
|
||||
maybe_height: Option<i32>,
|
||||
maybe_sampler: Option<String>,
|
||||
maybe_upload_path: Option<String>,
|
||||
maybe_lora_upload_path: Option<String>,
|
||||
maybe_cfg_scale: Option<f32>
|
||||
maybe_cfg_scale: Option<i32>,
|
||||
maybe_number_of_samples: Option<i64>,
|
||||
maybe_batch_size: Option<i32>,
|
||||
maybe_batch_count: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Serialize,ToSchema)]
|
||||
@@ -236,6 +243,7 @@ pub async fn enqueue_image_generation_request(
|
||||
let image_source_token = MediaFileToken(request.maybe_image_source.clone().unwrap_or_default());
|
||||
let sd_weight_token = ModelWeightToken(request.maybe_sd_model_token.clone().unwrap_or_default());
|
||||
let lora_token = ModelWeightToken(request.maybe_lora_model_token.clone().unwrap_or_default());
|
||||
|
||||
|
||||
let a_prompt = request.maybe_a_prompt.clone().unwrap_or_default();
|
||||
let n_prompt = request.maybe_n_prompt.clone().unwrap_or_default();
|
||||
|
||||
Reference in new issue
Block a user