Create a temporary upload URL for a file. Support multipart uploads. Return a list of URLs for each part of the file.
Parameters
civitai_model_url: Optional[str]
The civitai.com url of the model (example: “https://civitai.com/models/370194/translucent-subsurface-scattering-test?modelVersionId=413566”).
content_type: Optional[str]
Required for multipart upload. The MIME type of the file (example: “image/jpeg”)
file_name: Optional[str]
Required for multipart upload. The original file name of the image (example: “low-res-image.jpg”). It will be ignored if assetId is provided.
hugging_face_model_name: Optional[str]
The huggingface.co modelName (example: “stabilityai/stable-diffusion-xl-base-1.0”). 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"
}
}