From b2f95b91bf505d40b83d9f0ce14154993a5598ad Mon Sep 17 00:00:00 2001 From: vladmandic Date: Thu, 12 Mar 2026 09:20:15 +0100 Subject: [PATCH] cleanup upload Signed-off-by: vladmandic --- modules/api/upload.py | 11 ++++++----- wiki | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/api/upload.py b/modules/api/upload.py index 9133c7176..2683483a2 100644 --- a/modules/api/upload.py +++ b/modules/api/upload.py @@ -10,18 +10,19 @@ from modules.images import FilenameGenerator """ -new endpoint: /sdapi/v1/upload +new endpoint: `/sdapi/v1/upload` - if path is not given, file fill be uploaded to system temp folder - if path is given, its considered as relative to sdnext root (datadir) and must exist - absolute paths or paths outside of sdnext root are not allowed -example using post with formdata: -> curl -X POST "http://localhost:7860/sdapi/v1/upload" -F "file=@/home/vlado/dev/sdnext/config.json" -F overwrite=true -F path=data +example using post with form-data: +> curl -X POST "http://localhost:7860/sdapi/v1/upload" -F "file=@sdnext/config.json" -F overwrite=true -F path=data -example using put with raw bytes: -> curl -X PUT "http://localhost:7860/sdapi/v1/upload" -T config.json -H "filename:config.json" -H "path:data/" -H "overwrite:true" +example using put with raw-bytes: +> curl -X PUT "http://localhost:7860/sdapi/v1/upload" -T sdnext/config.json -H "filename:config.json" -H "path:data" -H "overwrite:true" """ + class ResUpload(BaseModel): input: str output: str diff --git a/wiki b/wiki index 9767b837b..ca56aaece 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 9767b837bb1031a5fe27d15b794c3a0d60950165 +Subproject commit ca56aaecedf08089e94a0bd0c97bcfa9f79cd731