reorder
This commit is contained in:
@@ -1596,7 +1596,6 @@ def _multi_ref_worker(job_id: str, filenames: list[str], prompts: list[str], pos
|
||||
# --- routes -----------------------------------------------------------------
|
||||
|
||||
class ConfigUpdate(BaseModel):
|
||||
prompt: str | None = None
|
||||
seed: int | None = None
|
||||
|
||||
|
||||
@@ -1610,14 +1609,12 @@ def get_config():
|
||||
def update_config(update: ConfigUpdate):
|
||||
with open(CONFIG_PATH, "r") as f:
|
||||
conf = json.load(f)
|
||||
if update.prompt is not None:
|
||||
conf["prompt"] = update.prompt
|
||||
if update.seed is not None:
|
||||
conf["seed"] = update.seed
|
||||
with open(CONFIG_PATH, "w") as f:
|
||||
json.dump(conf, f, indent=2)
|
||||
_invalidate_static()
|
||||
return {"prompt": conf["prompt"], "seed": conf["seed"]}
|
||||
return {"seed": conf["seed"]}
|
||||
|
||||
|
||||
class RepairRequest(BaseModel):
|
||||
@@ -2525,8 +2522,12 @@ def upload_image(
|
||||
prompt_list.extend(base_prompts)
|
||||
|
||||
if not prompt_list:
|
||||
# Use default prompt from config
|
||||
prompt_list = [conf.get("prompt", "high quality, masterpiece")]
|
||||
# Use default prompt from base_prompts or hardcoded fallback
|
||||
bp = conf.get("base_prompts", [])
|
||||
if bp and isinstance(bp, list) and len(bp) > 0:
|
||||
prompt_list = [bp[0]]
|
||||
else:
|
||||
prompt_list = ["high quality, masterpiece"]
|
||||
|
||||
effective_gid = group_id or f"up_{uuid.uuid4().hex[:8]}"
|
||||
background_tasks.add_task(_process_upload, file_path, filename, prompt_list, name, effective_gid)
|
||||
|
||||
Reference in New Issue
Block a user