Stable Diffusion with LoRAs · Image to Image
Entegre et
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/tr/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"
}
}
Stable Diffusion with LoRAs · Image to Image modelini (lora/image-to-image) Doitong API üzerinden çağırın. Ajanlar için belgeler: https://doitong.com/tr/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"
}
Yanıt durumu "queued" veya "running" ise, durum "succeeded" olana kadar GET https://api.doitong.com/v1/requests/REQUEST_ID?wait=20 ile yoklayın; dosyalar outputs[].url içindedir. Aynı gövdeyle POST https://api.doitong.com/v1/quote/lora/image-to-image, çalıştırmadan önce kesin fiyatı döndürür.
Bu istek: ≈$0,264 264 API kredisi Bu sayfada çalıştır
Yeni API anahtarınız. Yalnızca şimdi gösterilir ve zaten aşağıdaki kodda ve API anahtarı alanında bulunur. Gizli tutun: tarayıcıda çalışan kodlara asla eklemeyin.
İlk sonucunuz burada görünecek
Aşağıda bir istek oluşturun ve API anahtarınızla çalıştırın. Çıktılar depolamamıza kopyalanır ve sonsuza kadar veya ücretsiz olarak 7 gün boyunca saklanır.
İstek oluştur
Kontroller model şemasından oluşturulur. Değerleri değiştirdikçe kod ve fiyat güncellenir.
/run/lora/image-to-image?wait=20
fiyat → $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
}
}
}
Bu isteği çalıştır
Anahtarınız bu tarayıcıda kalır: yalnızca Doitong API'ye gönderilir ve yalnızca Hatırla seçeneğini işaretlerseniz localStorage'a kaydedilir. API anahtarı al
Stable Diffusion with LoRAs · Image to Image hakkında
`model_name` üzerinden seçilen bir Stable Diffusion modeliyle girdi `image_url` görselini dönüştürür. 0 ile 1 arasındaki `noise_strength`, sonucun kaynaktan ne kadar uzaklaşacağını belirler. Birleştirilmiş LoRA'lar, gömmeler, ControlNet'ler, IP adapter'lar ve birçok zamanlayıcı desteklenir. png veya jpeg olarak 1 ila 8 görsel üretir.
Parametreler
Kanonik adı veya yerel adı gönderin; ikisini birden göndermeyin. Kanonik adlar
model_namegerekli
unet_nameisteğe bağlı
variantisteğe bağlı
promptgerekli
negative_promptisteğe bağlı
prompt_weightingisteğe bağlı
image_urlisteğe bağlı
image
noise_strengthisteğe bağlı
lorasisteğe bağlı
loras[].pathgerekli
loras[].scaleisteğe bağlı
embeddingsisteğe bağlı
embeddings[].pathgerekli
embeddings[].tokensisteğe bağlı
controlnetsisteğe bağlı
controlnets[].pathgerekli
controlnets[].config_urlisteğe bağlı
controlnets[].variantisteğe bağlı
controlnets[].image_urlgerekli
controlnets[].mask_urlisteğe bağlı
controlnets[].conditioning_scaleisteğe bağlı
controlnets[].start_percentageisteğe bağlı
controlnets[].end_percentageisteğe bağlı
controlnets[].ip_adapter_indexisteğe bağlı
controlnet_guess_modeisteğe bağlı
ip_adapteristeğe bağlı
ip_adapter[].ip_adapter_image_urlgerekli
ip_adapter[].ip_adapter_mask_urlisteğe bağlı
ip_adapter[].pathgerekli
ip_adapter[].model_subfolderisteğe bağlı
ip_adapter[].weight_nameisteğe bağlı
ip_adapter[].insight_face_model_pathisteğe bağlı
ip_adapter[].scaleisteğe bağlı
ip_adapter[].scale_jsonisteğe bağlı
ip_adapter[].unconditional_noising_factoristeğe bağlı
ip_adapter[].image_projection_shortcutisteğe bağlı
image_encoder_pathisteğe bağlı
image_encoder_subfolderisteğe bağlı
image_encoder_weight_nameisteğe bağlı
ic_light_model_urlisteğe bağlı
ic_light_model_background_image_urlisteğe bağlı
ic_light_image_urlisteğe bağlı
seedisteğe bağlı
num_inference_stepsisteğe bağlı
guidance_scaleisteğe bağlı
clip_skipisteğe bağlı
scheduleristeğe bağlı
timestepsisteğe bağlı
timesteps.methodisteğe bağlı
timesteps.arrayisteğe bağlı
sigmasisteğe bağlı
sigmas.methodisteğe bağlı
sigmas.arrayisteğe bağlı
prediction_typeisteğe bağlı
rescale_betas_snr_zeroisteğe bağlı
image_formatisteğe bağlı
num_imagesisteğe bağlı
num_outputs
enable_safety_checkeristeğe bağlı
tile_widthisteğe bağlı
tile_heightisteğe bağlı
tile_stride_widthisteğe bağlı
tile_stride_heightisteğe bağlı
etaisteğe bağlı
debug_latentsisteğe bağlı
debug_per_pass_latentsisteğe bağlı
Dosya parametreleri herkese açık bir https:// URL'si, 10 MB'a kadar bir data: URI'si veya yüklenen bir dosyanın file_url değerini kabul eder. Dosyalar
Çıktı
{
"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"
}
}
Çıktı alanları
- images
- array of object {url, content_type, file_name, file_size, width, height}Üretilen görsellerin dosya bilgileri.
- seed
- integerGörsel üretimi seed'i; girdi seed sağlamadıysa rastgele seçilen değeri içerir, aksi durumda sağlanan değeri tekrarlar.
- has_nsfw_concepts
- array of booleanÜretilen görsellerde NSFW kavramlarının bulunup bulunmadığını belirtir.
- debug_latents
- object {url, content_type, file_name, file_size} | nullHata ayıklama için depolanan gizli veri.
- debug_per_pass_latents
- object {url, content_type, file_name, file_size} | nullHata ayıklama için geçiş başına depolanan gizli veri.
Diğer Stable Diffusion with LoRAs varyantları
Daha fazla model: Görsel Düzenleme
AI aracıları için: bu sayfanın Markdown biçimi şurada: https://doitong.com/tr/developers/models/lora/image-to-image.md. Tüm modeller ve kılavuzlar: https://doitong.com/developers/llms.txt






