ControlNet Preprocess MLSD
ControlNet Preprocess MLSD extracts major straight line segments from an input image for ControlNet conditioning. It is especially effective for buildings, interiors, product shots, and other compositions where rigid linear structure matters more than texture or organic detail.

API Reference
INTEGRATE
Complete technical specification for integration
RequestResponse
Examples4
CODE
Ready-to-use code snippets for common workflows
line-segment-extraction
Pipe Organ Venue Swap Guide$0.0006~4s
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
model: 'runware:controlnet-preprocess@mlsd',
inputs: {
image: 'https://assets.runware.ai/assets/inputs/7cac7fac-7a04-40fb-b3bd-215e89db1758.jpg'
}
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "runware:controlnet-preprocess@mlsd",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/7cac7fac-7a04-40fb-b3bd-215e89db1758.jpg"
}
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "controlNetPreprocess",
"taskUUID": "387adf3a-e0ed-4493-aae1-559f3c5aa766",
"model": "runware:controlnet-preprocess@mlsd",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/7cac7fac-7a04-40fb-b3bd-215e89db1758.jpg"
}
}
]'runware run runware:controlnet-preprocess@mlsd \
inputs.image=https://assets.runware.ai/assets/inputs/7cac7fac-7a04-40fb-b3bd-215e89db1758.jpg{
"taskType": "controlNetPreprocess",
"taskUUID": "387adf3a-e0ed-4493-aae1-559f3c5aa766",
"model": "runware:controlnet-preprocess@mlsd",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/7cac7fac-7a04-40fb-b3bd-215e89db1758.jpg"
}
}Response
{
"taskType": "imageControlNetPreProcess",
"taskUUID": "387adf3a-e0ed-4493-aae1-559f3c5aa766",
"guideImageURL": "https://im.runware.ai/image/os/a04d20/ws/3/ii/d9492d86-069f-495a-927c-aaf264ca0f1d.jpg",
"cost": 0.0006,
"guideImageUUID": "d9492d86-069f-495a-927c-aaf264ca0f1d",
"inputImageUUID": "7fd59ddf-6c62-4444-9797-c7882cef9942"
}line-segment-extraction
Seed Vault Emblem Vector Trace$0.0006~3s
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
model: 'runware:controlnet-preprocess@mlsd',
inputs: {
image: 'https://assets.runware.ai/assets/inputs/0c32afd9-9b1a-4f27-b86f-e46311bacbb0.jpg'
}
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "runware:controlnet-preprocess@mlsd",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/0c32afd9-9b1a-4f27-b86f-e46311bacbb0.jpg"
}
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "controlNetPreprocess",
"taskUUID": "9e5a0287-99b0-446c-a0d0-75cfeacae97d",
"model": "runware:controlnet-preprocess@mlsd",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/0c32afd9-9b1a-4f27-b86f-e46311bacbb0.jpg"
}
}
]'runware run runware:controlnet-preprocess@mlsd \
inputs.image=https://assets.runware.ai/assets/inputs/0c32afd9-9b1a-4f27-b86f-e46311bacbb0.jpg{
"taskType": "controlNetPreprocess",
"taskUUID": "9e5a0287-99b0-446c-a0d0-75cfeacae97d",
"model": "runware:controlnet-preprocess@mlsd",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/0c32afd9-9b1a-4f27-b86f-e46311bacbb0.jpg"
}
}Response
{
"taskType": "imageControlNetPreProcess",
"taskUUID": "9e5a0287-99b0-446c-a0d0-75cfeacae97d",
"guideImageURL": "https://im.runware.ai/image/os/a06dlim3/ws/3/ii/41607144-fa8b-4e43-9336-e8f8495b80cf.jpg",
"cost": 0.0006,
"guideImageUUID": "41607144-fa8b-4e43-9336-e8f8495b80cf",
"inputImageUUID": "29b5b3cf-e8b2-4821-b2e7-e48cadf56451"
}line-segment-extraction
Sento Gouache Restyle Structure Map$0.0013~4s
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
model: 'runware:controlnet-preprocess@mlsd',
inputs: {
image: 'https://assets.runware.ai/assets/inputs/46f42a98-578f-432a-83c5-ed9c55a8736c.jpg'
}
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "runware:controlnet-preprocess@mlsd",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/46f42a98-578f-432a-83c5-ed9c55a8736c.jpg"
}
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "controlNetPreprocess",
"taskUUID": "23313d8d-e11d-4575-bcd3-5ef3ef13d649",
"model": "runware:controlnet-preprocess@mlsd",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/46f42a98-578f-432a-83c5-ed9c55a8736c.jpg"
}
}
]'runware run runware:controlnet-preprocess@mlsd \
inputs.image=https://assets.runware.ai/assets/inputs/46f42a98-578f-432a-83c5-ed9c55a8736c.jpg{
"taskType": "controlNetPreprocess",
"taskUUID": "23313d8d-e11d-4575-bcd3-5ef3ef13d649",
"model": "runware:controlnet-preprocess@mlsd",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/46f42a98-578f-432a-83c5-ed9c55a8736c.jpg"
}
}Response
{
"taskType": "imageControlNetPreProcess",
"taskUUID": "23313d8d-e11d-4575-bcd3-5ef3ef13d649",
"guideImageURL": "https://im.runware.ai/image/os/a02d21/ws/3/ii/95f51360-2f90-46e4-96a5-51e28ba9958f.jpg",
"cost": 0.0013,
"guideImageUUID": "95f51360-2f90-46e4-96a5-51e28ba9958f",
"inputImageUUID": "0ccd2703-9496-43d0-b7f5-2c9270175ce7"
}line-segment-extraction
Modular Sauna Background Replacement Guide$0.0006~3s
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()
const [result] = await client.run({
model: 'runware:controlnet-preprocess@mlsd',
inputs: {
image: 'https://assets.runware.ai/assets/inputs/63f3fe3b-a432-4eb0-96e7-2d38c49bf572.jpg'
}
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "runware:controlnet-preprocess@mlsd",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/63f3fe3b-a432-4eb0-96e7-2d38c49bf572.jpg"
}
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "controlNetPreprocess",
"taskUUID": "1d8b7278-10cd-4515-a0df-c7dcbb6c16c4",
"model": "runware:controlnet-preprocess@mlsd",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/63f3fe3b-a432-4eb0-96e7-2d38c49bf572.jpg"
}
}
]'runware run runware:controlnet-preprocess@mlsd \
inputs.image=https://assets.runware.ai/assets/inputs/63f3fe3b-a432-4eb0-96e7-2d38c49bf572.jpg{
"taskType": "controlNetPreprocess",
"taskUUID": "1d8b7278-10cd-4515-a0df-c7dcbb6c16c4",
"model": "runware:controlnet-preprocess@mlsd",
"inputs": {
"image": "https://assets.runware.ai/assets/inputs/63f3fe3b-a432-4eb0-96e7-2d38c49bf572.jpg"
}
}Response
{
"taskType": "imageControlNetPreProcess",
"taskUUID": "1d8b7278-10cd-4515-a0df-c7dcbb6c16c4",
"guideImageURL": "https://im.runware.ai/image/os/a04d20/ws/3/ii/2b0d4768-7793-4903-8994-11c3dec98b2a.jpg",
"cost": 0.0006,
"guideImageUUID": "2b0d4768-7793-4903-8994-11c3dec98b2a",
"inputImageUUID": "6f901ec6-4732-4510-a778-74edb0b56219"
}