This commit is contained in:
mike
2026-06-27 13:51:51 +02:00
parent 4e23374093
commit 08a8cc9b82
5 changed files with 34 additions and 53 deletions

View File

@@ -162,14 +162,22 @@ def process_image(filename):
# Save temporary cropped image for upload
cropped_img.save(temp_path, format="PNG")
prompt = CONF.get("prompt")
if not prompt:
bp = CONF.get("base_prompts", [])
if bp and isinstance(bp, list) and len(bp) > 0:
prompt = bp[0]
else:
prompt = "high quality, masterpiece"
with open(temp_path, 'rb') as f:
files = {'image': (filename, f, 'image/png')}
data = {
'prompt': CONF["prompt"],
'prompt': prompt,
'seed': CONF.get("seed", -1),
'max_area': CONF.get("max_area", 0)
}
logging.info(f"Calling API for {filename} -> {output_filename} with prompt: {CONF['prompt']}")
logging.info(f"Calling API for {filename} -> {output_filename} with prompt: {prompt}")
response = requests.post(CONF["api_url"], files=files, data=data, timeout=600)
if response.status_code == 200: