mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-05 17:58:55 +00:00
enqueue is there. testing inference side.
This commit is contained in:
1 parent
4250469fd3
commit
8709fa9c8a
6 files changed
+39
-18
No files matched your search
@@ -971,8 +971,8 @@ pub async fn seed_weights(mysql_pool: &Pool<MySql>) -> AnyhowResult<()> {
|
||||
//original_seed_weights(mysql_pool,user_token).await?;
|
||||
//seed_weights_for_user_token(mysql_pool, user_token).await?;
|
||||
//seed_weights_for_paging(mysql_pool,user_token).await?;
|
||||
//seed_weights_for_testing_inference(mysql_pool,user_token).await?;
|
||||
println!("TESTING DOWLOAD");
|
||||
test_seed_weights_files().await?;
|
||||
seed_weights_for_testing_inference(mysql_pool,user_token).await?;
|
||||
//println!("TESTING DOWLOAD");
|
||||
//test_seed_weights_files().await?;
|
||||
Ok(())
|
||||
}
|
||||
-3
@@ -73,9 +73,6 @@ pub struct StableDiffusionArgs {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub maybe_number_of_samples: Option<i32>,
|
||||
|
||||
#[serde(rename = "bz")]
|
||||
pub maybe_batch_size: Option<i32>,
|
||||
|
||||
#[serde(rename = "bc")]
|
||||
pub maybe_batch_count: Option<i32>,
|
||||
|
||||
|
||||
@@ -104,6 +104,14 @@ VITS_INFERENCE_MAYBE_DOCKER_IMAGE_SHA="03017896367b"
|
||||
RERENDER_INFERENCE_ROOT_DIRECTORY="/home/salt/clone/storyteller-ml/animation/rerender-lora/"
|
||||
RERENDER_INFERENCE_EXECUTABLE_OR_COMMAND="venv/bin/python rerender.py"
|
||||
|
||||
# ================================= #
|
||||
# #
|
||||
# STABLE DIFFUSION #
|
||||
# #
|
||||
# ================================= #
|
||||
|
||||
STABLE_DIFFUSION_INFERENCE_COMMAND="/home/tensor/code/storyteller/storyteller-ml/image-gen"
|
||||
|
||||
# ================================= #
|
||||
# #
|
||||
# CACHE SETTINGS #
|
||||
|
||||
+4
-8
@@ -119,7 +119,6 @@ pub struct EnqueueImageGenRequest {
|
||||
maybe_lora_upload_path: Option<String>,
|
||||
maybe_cfg_scale: Option<i32>,
|
||||
maybe_number_of_samples: Option<i32>,
|
||||
maybe_batch_size: Option<i32>,
|
||||
maybe_batch_count: Option<i32>,
|
||||
}
|
||||
|
||||
@@ -189,6 +188,7 @@ pub async fn enqueue_image_generation_request(
|
||||
server_state: web::Data<Arc<ServerState>>
|
||||
) -> Result<HttpResponse, EnqueueImageGenRequestError> {
|
||||
|
||||
// TODO: Brandon need to figure out premium vs not premium
|
||||
let mut maybe_user_token: Option<UserToken> = None;
|
||||
let visbility = enums::common::visibility::Visibility::Public;
|
||||
let mut mysql_connection = server_state.mysql_pool.acquire().await.map_err(|err| {
|
||||
@@ -235,6 +235,8 @@ pub async fn enqueue_image_generation_request(
|
||||
}
|
||||
}
|
||||
|
||||
// DETECT premium user and queue
|
||||
|
||||
// ==================== RATE LIMIT ==================== //
|
||||
|
||||
let rate_limiter = match maybe_user_session {
|
||||
@@ -299,13 +301,9 @@ pub async fn enqueue_image_generation_request(
|
||||
None => 20,
|
||||
};
|
||||
|
||||
let batch_size = match request.maybe_batch_size {
|
||||
Some(val) => if val > 4 { 4 } else { val },
|
||||
None => 1,
|
||||
};
|
||||
|
||||
let batch_count = match request.maybe_batch_count {
|
||||
Some(val) => if val > 2 { 2 } else { val },
|
||||
Some(val) => if val > 4 { 4 } else { val },
|
||||
None => 1,
|
||||
};
|
||||
|
||||
@@ -336,7 +334,6 @@ pub async fn enqueue_image_generation_request(
|
||||
let type_of_inference = request.type_of_inference.to_string().clone();
|
||||
|
||||
|
||||
|
||||
let inference_args = StableDiffusionArgs {
|
||||
maybe_sd_model_token: Some(sd_weight_token),
|
||||
maybe_lora_model_token: Some(lora_token),
|
||||
@@ -350,7 +347,6 @@ pub async fn enqueue_image_generation_request(
|
||||
maybe_cfg_scale: Some(cfg_scale),
|
||||
maybe_number_of_samples: Some(number_of_samples),
|
||||
maybe_batch_count: Some(batch_count),
|
||||
maybe_batch_size: Some(batch_size),
|
||||
maybe_width: Some(width),
|
||||
maybe_height: Some(height),
|
||||
maybe_sampler: Some(sampler)
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"uuid_idempotency_token": "123",
|
||||
"type_of_inference": "checkpoint",
|
||||
"maybe_sd_model_token": "weight_dmmthavhawqc2hj7yqyemcbf8",
|
||||
"maybe_lora_model_token": "weight_t7gz78fjg27m0wtw6r33gafxs",
|
||||
"maybe_prompt": "a very well drawn, anime girl, with pink and purple hair sitting down on a chair relaxed.",
|
||||
"maybe_a_prompt": "a anime girl, with pink and purple hair sitting down on a chair relaxed.",
|
||||
"maybe_n_prompt": "nsfw, black and white, low quality, pixelated",
|
||||
"maybe_seed": "-1",
|
||||
"maybe_width": "512",
|
||||
"maybe_height": "512",
|
||||
"maybe_sampler": "DPM++ 2M SDE Heun",
|
||||
"maybe_upload_path": "https://drive.google.com/file/d/1WRgR2pn0Ky8ls5_9Zq6tQlHTBvyWeach/view?usp=sharing",
|
||||
"maybe_lora_upload_path": "https://drive.google.com/file/d/1WRgR2pn0Ky8ls5_9Zq6tQlHTBvyWeach/view?usp=sharing",
|
||||
"maybe_cfg_scale": "7",
|
||||
"maybe_number_of_samples": "32",
|
||||
"maybe_batch_count": "4"
|
||||
}
|
||||
@@ -195,10 +195,11 @@ pub fn add_routes<T, B> (app: App<T>, server_environment: ServerEnvironment) ->
|
||||
app = add_user_rating_routes(app); /* /v1/user_rating/... */
|
||||
app = add_subscription_routes(app); /* /v1/subscriptions/... */
|
||||
app = add_voice_designer_routes(app); /* /v1/voice_designer */
|
||||
|
||||
if server_environment == ServerEnvironment::Development {
|
||||
app = add_weights_routes(app); /* /v1/stubs/... */
|
||||
}
|
||||
app = add_image_gen_routes(app);
|
||||
app = add_weights_routes(app);
|
||||
// if server_environment == ServerEnvironment::Development {
|
||||
//
|
||||
// }
|
||||
// ==================== Comments ====================
|
||||
|
||||
let mut app = RouteBuilder::from_app(app)
|
||||
@@ -217,6 +218,7 @@ pub fn add_routes<T, B> (app: App<T>, server_environment: ServerEnvironment) ->
|
||||
.add_get("/v1/user_bookmarks/list/entity/{entity_type}/{entity_token}", list_user_bookmarks_for_entity_handler)
|
||||
.into_app();
|
||||
|
||||
|
||||
// ==================== Animations ====================
|
||||
|
||||
let mut app = RouteBuilder::from_app(app)
|
||||
|
||||
Reference in new issue
Block a user