model volume rename, env for flyio, public and private volumes tested tgt, everything is a public model (#3)

This commit is contained in:
Nick Kao 2024-01-26 18:21:15 -08:00 committed by GitHub
parent 95e454e687
commit ac5aba2aa9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 1306 additions and 9 deletions

View File

@ -5,3 +5,4 @@ CIVITAI_API_KEY=
# On production set to False
DEPLOY_TEST_FLAG=True
CIVITAI_API_KEY=
PUBLIC_MODEL_VOLUME_NAME=

View File

@ -47,7 +47,8 @@ machine_id_websocket_dict = {}
machine_id_status = {}
fly_instance_id = os.environ.get('FLY_ALLOC_ID', 'local').split('-')[0]
civitai_api_key = os.environ.get('FLY_ALLOC_ID', 'local').split('-')[0]
civitai_api_key = os.environ.get('FLY_ALLOC_ID', 'local')
public_model_volume_name = os.environ.get('PUBLIC_MODEL_VOLUME_NAME', 'local')
class FlyReplayMiddleware(BaseHTTPMiddleware):
@ -388,7 +389,7 @@ async def build_logic(item: Item):
"name": item.name,
"deploy_test": os.environ.get("DEPLOY_TEST_FLAG", "False"),
"gpu": item.gpu,
"public_model_volume": "model-store",
"public_model_volume": public_model_volume_name,
"private_model_volume": item.model_volume_name,
"pip": list(pip_modules)
}

Binary file not shown.

View File

@ -0,0 +1 @@
ALTER TABLE "comfyui_deploy"."models" ALTER COLUMN "is_public" SET DEFAULT true;

File diff suppressed because it is too large Load Diff

View File

@ -309,6 +309,13 @@
"when": 1706241449348,
"tag": "0043_wealthy_nicolaos",
"breakpoints": true
},
{
"idx": 44,
"version": "5",
"when": 1706317908300,
"tag": "0044_panoramic_mister_fear",
"breakpoints": true
}
]
}

View File

@ -90,7 +90,7 @@ export const columns: ColumnDef<ModelItemList>[] = [
</span>
{model.is_public
? <Badge variant="green">Public</Badge>
? <></>
: <Badge variant="orange">Private</Badge>}
</>
);

View File

@ -414,7 +414,7 @@ export const modelTable = dbSchema.table("models", {
s3_url: text("s3_url"),
user_url: text("client_url"),
is_public: boolean("is_public").notNull().default(false),
is_public: boolean("is_public").notNull().default(true),
status: resourceUpload("status").notNull().default("started"),
upload_machine_id: text("upload_machine_id"), // TODO: review if actually needed
upload_type: modelUploadType("upload_type").notNull(),

View File

@ -90,11 +90,10 @@ export async function addModelVolume() {
.values({
user_id: userId,
org_id: orgId,
volume_name: `checkpoints_${userId}`,
// created_at and updated_at will be set to current timestamp by default
disabled: false, // Default value
volume_name: `models_${orgId ? orgId: userId}`, // if orgid is avalible use as part of the volume name
disabled: false,
})
.returning(); // Returns the inserted row
.returning();
return insertedVolume;
}
@ -121,7 +120,6 @@ export const addCivitaiModel = withServerPromise(
const civitaiModelRes = await fetch(url)
.then((x) => x.json())
.then((a) => {
console.log(a);
return CivitaiModelResponse.parse(a);
});