How to use it in api? #88
Unanswered
MagicReader
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
"sd upscale" for example:
async def Req2neuro():
#IMG2IMG CONFIG
url_:str='http://127.0.0.1:646/'; image:str=""; scale:int=2;
overlap:int=64; upscaler:str="R-ESRGAN 4x+ Anime6B"; denoise_str=0.75;
prompt:str='test'; negative_prompt:str=' '; width:int=512; height:int=512; cfg_scale:float=7.5;
model:str='PastelMix.safetensors'; sampler:str='Euler';
steps:int=25; n_iter:int=1; vae:str="vae-ft-ema-560000-ema-pruned.safetensors"
#SCRIPT CONFIG
scale:int=2; overlap:int=64; upscaler:str="R-ESRGAN 4x+ Anime6B"
image= await put_image('1.png')
json_settings = {
'sd_model_checkpoint': model,
"sd_vae": vae,
}
json_payload={
"init_images": [image],
"denoising_strength": denoise_str,
"prompt": prompt,
"n_iter": n_iter,
"steps": steps,
"cfg_scale": cfg_scale,
"width": width,
"height": height,
"negative_prompt": negative_prompt,
'override_settings': json_settings,
"sampler_index": sampler,
"tiling": True,
"script_name": "sd upscale",
"script_args": [None, overlap, upscaler, scale, ]
}
response = requests.post(url=f'{url_}/sdapi/v1/txt2img',json=json_payload, timeout=900)
await save_json(response, 'resp.json')
Beta Was this translation helpful? Give feedback.
All reactions