Skip to main content

Make Photo


Make Photo

POST https://api.novita.ai/v3/async/make-photo

Customizing Realistic Human Photos via Stacked ID Embedding.

This is an asynchronous API, only the task_id will be returned. You should use the task_id to request the Task Result API at https://novita.ai/reference/task/task.htmlopen in new window to retrieve the image generation results.

Request header parameters

  • Content-TypestringRequired

    undefined

    Enum:
    application/json
  • AuthorizationstringRequired

    Bearer authentication format, for example: Bearer {{API Key}}.

Request Body parameters

  • extraobject

    Optional extra parameters for the request.

    Show properties
  • model_namestringRequired

    Name of SDXL based model, retrieve the corresponding sd_name value by invoking the https://novita.ai/reference/model/query_model.html API with filter.types=checkpoint&filter.is_sdxl=true as the query parameter.

  • image_assets_ids[string]Required

    Get asset id with guidance https://novita.ai/reference/face_editor/instant-id.html#get-image-assets-id.

  • promptstringRequired

    Text input required to guide the image generation, divided by `,`, Range [1, 1024].

  • negative_promptstringRequired

    Text input that will not guide the image generation, divided by `,`, Range [1, 1024].

  • loras[object]Required

    LoRA is a fast and lightweight training method that inserts and trains a significantly smaller number of parameters instead of all the model parameters. Currenlty supports up to 5 LoRAs.

    Show properties
  • strengthnumberRequired

    The amount of noise it adds is controlled, the larger of the value, the greater the difference from the original image, Range [0, 1].

  • widthintegerRequired

    Width of image, Range [128, 1024].

  • heightintegerRequired

    Height of image, Range [128, 1024].

  • image_numintegerRequired

    Images numbers generated in one single generation, Range [1, 8].

  • stepsintegerRequired

    The number of denoising steps. More steps usually can produce higher quality images, but take more time to generate, Range [1, 100].

  • seedintegerRequired

    A seed is a number from which Stable Diffusion generates noise, which, makes generation deterministic. Using the same seed and set of parameters will produce identical image each time, minimum -1.

  • guidance_scalenumberRequired

    This setting says how close the Stable Diffusion will listen to your prompt, higer guidance forces the model to better follow the prompt, but result in lower quality output.Range [1, 30].

  • sampler_namestringRequired

    This parameter determines the denoising algorithm employed during the sampling phase of Stable Diffusion. Each option represents a distinct method by which the model incrementally generates new images. These algorithms differ significantly in their processing speed, output quality, and the specific characteristics of the images they generate, allowing users to tailor the image generation process to meet precise requirements. Get reference at https://novita.ai/get-started/Misc.htmll#what-is-samplers.

    Enum:
    Euler aEulerLMSHeunDPM2DPM2 aDPM++ 2S aDPM++ 2MDPM++ SDEDPM fastDPM adaptiveLMS KarrasDPM2 KarrasDPM2 a KarrasDPM++ 2S a KarrasDPM++ 2M KarrasDPM++ SDE KarrasDDIMPLMSUniPC

Responses

Example

This API customizing Realistic Human Photos via Stacked ID Embedding. The returned photos can be access by API /v3/async/task-result with task_id.

novita.ai API

Get image assets id

Request:

curl -X PUT -T "{{image file path}}" 'https://assets.novitai.com/image'

Response:

{
    "assets_id":"cjIvbm92aXRhLWFpLWFzc2V0L2ltYWdlL2lHc2VkR2NOQjRaS000YThRUkQ3MmVoUVo1c0tDelBK"
}

Image files:

novita.ai API

Request Make Photo API

Use image assets id generated from step 18.1 to request API. Current only SDXL based model supported.

Below are the supported models:

albedobaseXL_v04_130099.safetensors
altxl_v60_146691.safetensors
animeArtDiffusionXL_alpha2_91872.safetensors
animeArtDiffusionXL_alpha3_93120.safetensors
animeIllustDiffusion_v04_117809.safetensors
breakdomainxl_V05g_124265.safetensors
brixlAMustInYour_v40Dagobah_145992.safetensors
cinemaxAlphaSDXLCinema_alpha1_107473.safetensors
cineroXLPhotomatic_v12aPHENO_137703.safetensors
clearhungAnimeXL_v10_117716.safetensors
copaxTimelessxlSDXL1_colorfulV2_100729.safetensors
counterfeitxl__98184.safetensors
counterfeitxl_v10_108721.safetensors
crystalClearXL_ccxl_97637.safetensors
dreamshaperXL09Alpha_alpha2Xl10_91562.safetensors
dynavisionXLAllInOneStylized_alpha036FP16Bakedvae_99980.safetensors
dynavisionXLAllInOneStylized_beta0411Bakedvae_109970.safetensors
dynavisionXLAllInOneStylized_release0534bakedvae_129001.safetensors
fenrisxl_145_134980.safetensors
foddaxlPhotorealism_v45_122788.safetensors
formulaxl_v10_104889.safetensors
juggernautXL_version2_113240.safetensors
juggernautXL_version5_126522.safetensors
kohakuXL_alpha7_111843.safetensors
LahMysteriousSDXL_v40_122478.safetensors
leosamsHelloworldSDXLModel_helloworldSDXL10_112178.safetensors
mbbxlUltimate_v10RC_94686.safetensors
moefusionSDXL_v10_114018.safetensors
nightvisionXLPhotorealisticPortrait_beta0681Bakedvae_108833.safetensors
nightvisionXLPhotorealisticPortrait_beta0702Bakedvae_113098.safetensors
nightvisionXLPhotorealisticPortrait_release0770Bakedvae_154525.safetensors
novaPrimeXL_v10_107899.safetensors
pixelwave_v10_117722.safetensors
protovisionXLHighFidelity3D_beta0520Bakedvae_106612.safetensors
protovisionXLHighFidelity3D_release0620Bakedvae_131308.safetensors
protovisionXLHighFidelity3D_release0630Bakedvae_154359.safetensors
realismEngineSDXL_v05b_131513.safetensors
realismEngineSDXL_v10_136287.safetensors
realisticStockPhoto_v10_115618.safetensors
RealitiesEdgeXL_4_122673.safetensors
realvisxlV20_v20Bakedvae_129156.safetensors
riotDiffusionXL_v20_139293.safetensors
roxl_v10_109354.safetensors
sd_xl_base_0.9.safetensors
sd_xl_base_1.0.safetensors
sdxlNijiSpecial_sdxlNijiSE_115638.safetensors
sdxlNijiV3_sdxlNijiV3_104571.safetensors
sdxlNijiV51_sdxlNijiV51_112807.safetensors
sd_xl_refiner_1.0.safetensors
sdxlUnstableDiffusers_v8HEAVENSWRATH_133813.safetensors
sdXL_v10Refiner_91495.safetensors
sdxlYamersAnimeUltra_yamersAnimeV3_121537.safetensors
shikianimexl_v10_93788.safetensors
stable-diffusion-xl-1.0-inpainting-0.1.safetensors
stable-diffusion-xl-base-1.0.safetensors
theTalosProject_v10_117893.safetensors
thinkdiffusionxl_v10_145931.safetensors
voidnoisecorexl_r1486_150780.safetensors
wlopArienwlopstylexl_v10_101973.safetensors
wlopSTYLEXL_v2_126171.safetensors
xl13AsmodeusSFWNSFW_v22BakedVAE_111954.safetensors
xxmix9realisticsdxl_v10_123235.safetensors
zavychromaxl_b2_103298.safetensors
zavychromaxl_v21_129006.safetensors

Request:

curl --location 'https://api.novita.ai/v3/async/make-photo' \
--header 'Authorization: Bearer {{key}}' \
--header 'Content-Type: application/json' \
--data '{
    "extra": {
        "response_image_type": "jpeg"
    },
    "model_name": "protovisionXLHighFidelity3D_release0620Bakedvae_131308.safetensors",
    "image_assets_ids": [
        "cjIvbm92aXRhLWFpLWFzc2V0L2ltYWdlL2lHc2VkR2NOQjRaS000YThRUkQ3MmVoUVo1c0tDelBK"
    ],
    "loras": [
        {"model_name": "xl_more_art-full_v1_113467.safetensors" , "strength": 0.5}
    ],
    "prompt": "concept art of a man . digital artwork, illustrative, painterly, matte painting, highly detailed",
    "negative_prompt": "realistic, photo-realistic, bad quality, bad anatomy, worst quality, low quality, lowres, extra fingers, blur, blurry, ugly, wrong proportions, watermark, image artifacts, bad eyes, bad hands, bad arms",
    "height": 1024,
    "width": 1024,
    "image_num": 1,
    "steps": 50,
    "seed": -1,
    "clip_skip": 1,
    "guidance_scale": 7.5,
    "sampler_name": "Euler a",
    "strength": 0.15,
    "crop_face": true
}'

Response:

{
    "task_id": "6469ca5b-5929-4200-b263-241020763eb8"
}

Use task_id to get images

HTTP status codes in the 2xx range indicate that the request has been successfully accepted, while status codes in the 5xx range indicate internal server errors.

You can get result in images of response.

Request:

curl --location --request GET 'https://api.novita.ai/v3/async/task-result?task_id=6469ca5b-5929-4200-b263-241020763eb8' \
--header 'Authorization: Bearer {{key}}'

Response:

{
    "extra": {
        "seed": "724000352"
    },
    "task": {
        "task_id": "0a543c69-41b9-4b36-9b08-a9c0681b5f59",
        "task_type": "MAKE_PHOTO",
        "status": "TASK_STATUS_SUCCEED",
        "reason": "",
        "eta": 0,
        "progress_percent": 0
    },
    "images": [            
        "image_url": "https://faas-output-image.s3.ap-southeast-1.amazonaws.com/test/0a543c69-41b9-4b36-9b08-a9c0681b5f59/1ab660af2a24402a8b99dd83a44e40dd.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASVPYCN6LRCW3SOUV%2F20240117%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20240117T145407Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&x-id=GetObject&X-Amz-Signature=406093ab4d203907d683021a210688f1cf275996691dc251fe6d992b0234c301",
        "image_url_ttl": "3600",
        "image_type": ""],
    "videos": []
}

images files:

novita.ai API
novita.ai API