Create a temporary upload URL for a file. Support multipart uploads. Return a list of URLs for each part of the file.
Parameters
The projectId used for ownership resource management. Either to assert ownership or to set the owner of the resource(s)
The civitai.com url of the model (example: “https://civitai.com/models/370194/translucent-subsurface-scattering-test?modelVersionId=413566”).
Required for multipart upload. The MIME type of the file (example: “image/jpeg”)
Required for multipart upload. The original file name of the image (example: “low-res-image.jpg”). It will be ignored if assetId is provided.
The huggingface.co modelName (example: “black-forest-labs/FLUX.1-dev”). No need to setup other fields if you setup huggingFaceModelName
Create
import os
from scenario_sdk import Scenario
client = Scenario(
api_key=os.environ.get("SCENARIO_SDK_API_KEY"), # This is the default and can be omitted
api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"), # This is the default and can be omitted
)
upload = client.uploads.create()
print(upload.upload){
"upload": {
"id": "id",
"authorId": "authorId",
"createdAt": "createdAt",
"fileName": "fileName",
"kind": "3d",
"ownerId": "ownerId",
"source": "civitai",
"status": "complete",
"updatedAt": "updatedAt",
"assetOptions": {
"collectionIds": [
"string"
],
"hide": true,
"parentId": "parentId"
},
"config": {},
"contentType": "contentType",
"entityId": "entityId",
"errorMessage": "errorMessage",
"fileSize": 0,
"jobId": "jobId",
"originalFileName": "originalFileName",
"parts": [
{
"expires": "expires",
"number": 0,
"url": "url"
}
],
"partsCount": 0,
"provider": "civitai",
"url": "url"
}
}Returns Examples
{
"upload": {
"id": "id",
"authorId": "authorId",
"createdAt": "createdAt",
"fileName": "fileName",
"kind": "3d",
"ownerId": "ownerId",
"source": "civitai",
"status": "complete",
"updatedAt": "updatedAt",
"assetOptions": {
"collectionIds": [
"string"
],
"hide": true,
"parentId": "parentId"
},
"config": {},
"contentType": "contentType",
"entityId": "entityId",
"errorMessage": "errorMessage",
"fileSize": 0,
"jobId": "jobId",
"originalFileName": "originalFileName",
"parts": [
{
"expires": "expires",
"number": 0,
"url": "url"
}
],
"partsCount": 0,
"provider": "civitai",
"url": "url"
}
}