someone-in-the-world Claude Sonnet 4.6 commited on
Commit
b00e42b
·
1 Parent(s): c1e4742

Move negative prompt into static/negative_prompt.txt

Browse files

Editorial content — easier to tune without touching inference logic.
Read once at startup alongside other static files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (2) hide show
  1. app.py +3 -1
  2. static/negative_prompt.txt +1 -0
app.py CHANGED
@@ -363,7 +363,6 @@ def infer(images_b64_json, prompt, seed, randomize_seed, guidance_scale, steps,
363
  if randomize_seed:
364
  seed = random.randint(0, MAX_SEED)
365
  generator = torch.Generator(device=device).manual_seed(seed)
366
- negative_prompt = "worst quality, low quality, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry"
367
  width, height = update_dimensions_on_upload(pil_images[0])
368
  print(f"[infer] input={pil_images[0].size}, output={width}x{height}, seed={seed}")
369
 
@@ -434,6 +433,9 @@ with open("static/wire_outputs.js") as _f:
434
  with open("static/run_preprocess.js") as _f:
435
  run_preprocess_js = _f.read()
436
 
 
 
 
437
  # ── HTML template ──────────────────────────────────────────────────────────────
438
 
439
  with open("templates/app.html") as _f:
 
363
  if randomize_seed:
364
  seed = random.randint(0, MAX_SEED)
365
  generator = torch.Generator(device=device).manual_seed(seed)
 
366
  width, height = update_dimensions_on_upload(pil_images[0])
367
  print(f"[infer] input={pil_images[0].size}, output={width}x{height}, seed={seed}")
368
 
 
433
  with open("static/run_preprocess.js") as _f:
434
  run_preprocess_js = _f.read()
435
 
436
+ with open("static/negative_prompt.txt") as _f:
437
+ negative_prompt = _f.read().strip()
438
+
439
  # ── HTML template ──────────────────────────────────────────────────────────────
440
 
441
  with open("templates/app.html") as _f:
static/negative_prompt.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ worst quality, low quality, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry