Stable Diffusion with LoRAs · Image to Image
Integracija
lora/image-to-image
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/lora/image-to-image?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model_name": "stabilityai/stable-diffusion-xl-base-1.0",
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.com/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/lora/image-to-image?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"model_name": "stabilityai/stable-diffusion-xl-base-1.0",
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"model_name": "stabilityai/stable-diffusion-xl-base-1.0",
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/lora/image-to-image", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
# 1. Connect once (Claude Code; Cursor, VS Code, Claude Desktop: https://doitong.com/sl/developers/docs/mcp)
claude mcp add --transport http doitong-models https://api.doitong.com/v1/mcp \
--header "Authorization: Bearer $DOITONG_API_KEY"
# 2. Your agent calls the "run" tool with:
{
"model_id": "lora/image-to-image",
"input": {
"model_name": "stabilityai/stable-diffusion-xl-base-1.0",
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}
}
Pokličite model Stable Diffusion with LoRAs · Image to Image (lora/image-to-image) prek Doitong API. Dokumentacija za agente: https://doitong.com/sl/developers/models/lora/image-to-image.md
POST https://api.doitong.com/v1/run/lora/image-to-image?wait=20
Authorization: Bearer $DOITONG_API_KEY
Content-Type: application/json
{
"model_name": "stabilityai/stable-diffusion-xl-base-1.0",
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}
Če je stanje odgovora "queued" ali "running", pošiljajte poizvedbe GET https://api.doitong.com/v1/requests/REQUEST_ID?wait=20, dokler ni "succeeded"; datoteke so v outputs[].url. POST https://api.doitong.com/v1/quote/lora/image-to-image z enakim telesom vrne natančno ceno pred zagonom.
Ta zahteva: ≈0,264 $ 264 API kreditov Zaženi na tej strani
Vaš novi ključ API. Prikazan je samo zdaj in je že v kodi ter v spodnjem polju ključa API. Hranite ga kot skrivnost: nikoli ga ne vključite v kodo, ki se izvaja v brskalniku.
Tukaj bo vaš prvi rezultat
Spodaj sestavite zahtevo in jo zaženite s svojim ključem API. Izhodi se kopirajo v našo shrambo, kjer se hranijo za vedno ali 7 dni brezplačno.
Ustvari zahtevo
Kontrolniki se ustvarijo iz sheme modela. Koda in cena se posodobita, ko ju spreminjate.
/run/lora/image-to-image?wait=20
cena → 0,264 $
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/lora/image-to-image?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model_name": "stabilityai/stable-diffusion-xl-base-1.0",
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.com/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/lora/image-to-image?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"model_name": "stabilityai/stable-diffusion-xl-base-1.0",
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"model_name": "stabilityai/stable-diffusion-xl-base-1.0",
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/lora/image-to-image", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run",
"arguments": {
"model_id": "lora/image-to-image",
"input": {
"model_name": "stabilityai/stable-diffusion-xl-base-1.0",
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
},
"wait_seconds": 20
}
}
}
Zaženi to zahtevo
Vaš ključ ostane v tem brskalniku: pošlje se samo v Doitong API in shrani v localStorage samo, če označite možnost Zapomni si. Pridobi ključ API
O modelu Stable Diffusion with LoRAs · Image to Image
Preoblikuje vhodni `image_url` z izbranim modelom Stable Diffusion, nastavljenim prek `model_name`. `noise_strength` od 0 do 1 določa oddaljenost rezultata od izvirnika. Podpira združene LoRA, vložitve, ControlNets, adapterje IP in številne razporejevalnike. Ustvari od 1 do 8 slik v png ali jpeg.
Parametri
Pošlji kanonično ali izvorno ime, ne obeh. Kanonična imena
model_nameobvezno
unet_nameneobvezno
variantneobvezno
promptobvezno
negative_promptneobvezno
prompt_weightingneobvezno
image_urlneobvezno
image
noise_strengthneobvezno
lorasneobvezno
loras[].pathobvezno
loras[].scaleneobvezno
embeddingsneobvezno
embeddings[].pathobvezno
embeddings[].tokensneobvezno
controlnetsneobvezno
controlnets[].pathobvezno
controlnets[].config_urlneobvezno
controlnets[].variantneobvezno
controlnets[].image_urlobvezno
controlnets[].mask_urlneobvezno
controlnets[].conditioning_scaleneobvezno
controlnets[].start_percentageneobvezno
controlnets[].end_percentageneobvezno
controlnets[].ip_adapter_indexneobvezno
controlnet_guess_modeneobvezno
ip_adapterneobvezno
ip_adapter[].ip_adapter_image_urlobvezno
ip_adapter[].ip_adapter_mask_urlneobvezno
ip_adapter[].pathobvezno
ip_adapter[].model_subfolderneobvezno
ip_adapter[].weight_nameneobvezno
ip_adapter[].insight_face_model_pathneobvezno
ip_adapter[].scaleneobvezno
ip_adapter[].scale_jsonneobvezno
ip_adapter[].unconditional_noising_factorneobvezno
ip_adapter[].image_projection_shortcutneobvezno
image_encoder_pathneobvezno
image_encoder_subfolderneobvezno
image_encoder_weight_nameneobvezno
ic_light_model_urlneobvezno
ic_light_model_background_image_urlneobvezno
ic_light_image_urlneobvezno
seedneobvezno
num_inference_stepsneobvezno
guidance_scaleneobvezno
clip_skipneobvezno
schedulerneobvezno
timestepsneobvezno
timesteps.methodneobvezno
timesteps.arrayneobvezno
sigmasneobvezno
sigmas.methodneobvezno
sigmas.arrayneobvezno
prediction_typeneobvezno
rescale_betas_snr_zeroneobvezno
image_formatneobvezno
num_imagesneobvezno
num_outputs
enable_safety_checkerneobvezno
tile_widthneobvezno
tile_heightneobvezno
tile_stride_widthneobvezno
tile_stride_heightneobvezno
etaneobvezno
debug_latentsneobvezno
debug_per_pass_latentsneobvezno
Parametri datotek sprejmejo javni https:// URL, podatkovni URI data: do 10 MB ali file_url naložene datoteke. Datoteke
Izhod
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "lora/image-to-image",
"status": "succeeded",
"created_at": "2026-10-20T12:00:00Z",
"started_at": "2026-10-20T12:00:02Z",
"completed_at": "2026-10-20T12:00:09Z",
"queue_position": null,
"cost": {
"credits": 264,
"usd": "0.264",
"charged": 264,
"refunded": 0
},
"input": {
"model_name": "stabilityai/stable-diffusion-xl-base-1.0",
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
},
"output": {
"images": [
{
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
"content_type": "image/jpeg",
"file_name": "0-output.jpeg",
"file_size": 1843200,
"width": 1024,
"height": 768
}
],
"seed": 42,
"has_nsfw_concepts": [
false
],
"debug_latents": {
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
"content_type": "image/jpeg",
"file_name": "0-output.jpeg",
"file_size": 1843200
},
"debug_per_pass_latents": {
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
"content_type": "image/jpeg",
"file_name": "0-output.jpeg",
"file_size": 1843200
}
},
"outputs": [
{
"type": "image",
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
"content_type": "image/jpeg",
"file_size": 1843200,
"width": 1024,
"height": 768,
"stored": true
}
],
"error": null,
"metrics": {
"inference_seconds": 6.8
},
"urls": {
"self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
"cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
}
}
Polja izhoda
- images
- array of object {url, content_type, file_name, file_size, width, height}Podatki o datotekah ustvarjenih slik.
- seed
- integerSeme za generiranje slike, vključno z naključno izbrano vrednostjo, če vhod ni vseboval semena; sicer ponovi podano vrednost.
- has_nsfw_concepts
- array of booleanOznačuje, ali se v generiranih slikah pojavljajo koncepti NSFW.
- debug_latents
- object {url, content_type, file_name, file_size} | nullLatentni podatki, shranjeni za razhroščevanje.
- debug_per_pass_latents
- object {url, content_type, file_name, file_size} | nullLatentni podatki po prehodih, shranjeni za razhroščevanje.
Druge različice Stable Diffusion with LoRAs
Več modelov: Urejanje slik
Za agente AI: ta stran je v obliki Markdown na voljo na https://doitong.com/sl/developers/models/lora/image-to-image.md. Vsi modeli in vodniki: https://doitong.com/developers/llms.txt






