o1-preview-2024-09-12· OpenAI
WildChat-4.8M (AI2)
Create civitai curl api endpoint for load model safetensor using (UNR:AIR) code…
- User
Create civitai curl api endpoint for load model safetensor using (UNR:AIR) code variable:{input_air_code}
- Assistant
To load a model safetensor from Civitai using a code variable
{input_air_code}, you can use the followingcurlcommand, which utilizes the Civitai API endpoint:curl -L -o model.safetensors "https://civitai.com/api/download/models/{input_air_code}"Explanation:
curl: Command-line tool for transferring data with URLs.-L: Follow redirects if the URL is redirected.-o model.safetensors: Output the downloaded content to a file namedmodel.safetensors."https://civitai.com/api/download/models/{input_air_code}": The Civitai API endpoint to download a model using the model version ID provided by{input_air_code}.
Instructions:
-
Replace
{input_air_code}with your actual model version ID or code. This ID should correspond to the specific model version you wish to download from Civitai.For example:
input_air_code=12345 curl -L -o model.safetensors "https://civitai.com/api/download/models/$input_air_code" -
Run the command in your terminal or command prompt.
Note:
- Ensure you have
curlinstalled on your system. - The downloaded file will be saved in the current directory with the name
model.safetensors. - The
{input_air_code}should be a valid model version ID from Civitai. You can obtain this ID from the model's URL on Civitai. For example, if the model URL ishttps://civitai.com/models/12345/model-name, then the model version ID might be12345. - If authentication is required (e.g., for private models or API rate limits), you may need to include additional headers or authentication tokens in your
curlcommand.
Example with Variable:
# Assign your model version ID to the variable input_air_code=12345 # Use the variable in the curl command curl -L -o model.safetensors "https://civitai.com/api/download/models/$input_air_code"Feel free to customize the output filename or add any additional options to
curlas needed for your use case.