Skip to content
TheChatArchiveThe Chat Archive
o1-preview-2024-09-12· OpenAIAi2 WildChat-4.8M (AI2)

Create civitai curl api endpoint for load model safetensor using (UNR:AIR) code…

  1. User

    Create civitai curl api endpoint for load model safetensor using (UNR:AIR) code variable:{input_air_code}

  2. Assistant

    To load a model safetensor from Civitai using a code variable {input_air_code}, you can use the following curl command, 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 named model.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:

    1. 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"
      
    2. Run the command in your terminal or command prompt.

    Note:

    • Ensure you have curl installed 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 is https://civitai.com/models/12345/model-name, then the model version ID might be 12345.
    • 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 curl command.

    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 curl as needed for your use case.