Township UI: profile management, regenerate/upload refs, env parity

Web UI (tools/gen_township_fighters.py):
- Characters and Environments management pages: edit every meta field
  (data-driven form, not a fixed set), remove a profile, delete individual
  reference images — synced to CoderAI (DELETE/PATCH).
- Regenerate references: background job generates N new images guided by the
  kept references (IP-Adapter) and APPENDS them, preserving non-deleted ones.
- Upload your own reference image files (magic-byte validated, appended).
- Clear run banner + status-pill label indicating which run/step is executing.
- Config: -s/--save and -c/--config; web Save button writes server-side and,
  when launched with -c, defaults to that same config path.

Environment parity / consistency:
- Per-environment identity LoRAs (loras.py: environment field, env image
  resolver, "place" instance prompt; script stage_env_loras, env_loras.json,
  applied to keyframes + video alongside fighter LoRAs).
- Environment IP-Adapter: environment_profiles on the image request
  (imagerequest.py) resolved into the IP-Adapter reference set (images.py),
  so environment regeneration can match kept references.
Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
parent f5cb44e1
This diff is collapsed.
This diff is collapsed.
...@@ -21,6 +21,13 @@ from typing import Dict, List, Optional ...@@ -21,6 +21,13 @@ from typing import Dict, List, Optional
from pydantic import BaseModel, ConfigDict from pydantic import BaseModel, ConfigDict
class LoraConfig(BaseModel):
model: str
weight: float = 1.0
name: Optional[str] = None
model_config = ConfigDict(extra="allow")
class ImageGenerationRequest(BaseModel): class ImageGenerationRequest(BaseModel):
model: str model: str
prompt: str prompt: str
...@@ -36,10 +43,15 @@ class ImageGenerationRequest(BaseModel): ...@@ -36,10 +43,15 @@ class ImageGenerationRequest(BaseModel):
disable_safety_checker: Optional[bool] = False disable_safety_checker: Optional[bool] = False
negative_prompt: Optional[str] = None negative_prompt: Optional[str] = None
# Per-request component overrides
vae_model: Optional[str] = None # Override the VAE for this request
loras: Optional[List[LoraConfig]] = None # Additional LoRA weights for this request
# Character consistency # Character consistency
character_profiles: Optional[List[str]] = None # saved profile names character_profiles: Optional[List[str]] = None # saved profile names
character_references: Optional[List[str]] = None # inline base64 images character_references: Optional[List[str]] = None # inline base64 images
character_strength: Optional[float] = 0.6 # IP-Adapter scale character_strength: Optional[float] = 0.6 # IP-Adapter scale
environment_profiles: Optional[List[str]] = None # saved environment profile names (IP-Adapter)
model_config = ConfigDict(extra="allow") model_config = ConfigDict(extra="allow")
...@@ -47,4 +59,4 @@ class ImageGenerationRequest(BaseModel): ...@@ -47,4 +59,4 @@ class ImageGenerationRequest(BaseModel):
class ImageGenerationResponse(BaseModel): class ImageGenerationResponse(BaseModel):
created: int created: int
data: List[Dict] data: List[Dict]
model_config = ConfigDict(extra="allow") model_config = ConfigDict(extra="allow")
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment