LeafCat79 commited on
Commit
fda9ce2
·
verified ·
1 Parent(s): 2e6e9aa

Document direct text-to-image generation

Browse files

Document that the production model receives written prompts only and no procedural image guide.

Files changed (1) hide show
  1. README.md +5 -7
README.md CHANGED
@@ -33,7 +33,7 @@ Generated sprites receive automated dimension, alpha-channel, and corner-transpa
33
 
34
  The UI reports the configured prompt and image pipeline and labels every role with its actual source. Every asset carries a normalized camera contract (`top_down`, `side_view`, `isometric`, `first_person`, or `front_view`). Top-down background prompts explicitly forbid a sky, horizon, eye-level view, and front-facing facades.
35
 
36
- Procedural generators provide predictable structure and real transparency but have limited open-ended semantic fidelity. Diffusion models provide more visual variety but are more likely to miss perspective, subject, background, or edge constraints; sprite outputs therefore receive alpha post-processing and still require visual approval. Background and sprite diffusion runs use different negative prompts so valid characters and vehicles are not accidentally excluded from sprite generation.
37
 
38
  The app combines the game type, perspective, theme, and pasted code into explicit per-role image prompts, then generates PNG assets and embeds contract-compatible assets as base64 data URIs.
39
 
@@ -47,11 +47,11 @@ The deployed Space is designed for Hugging Face ZeroGPU and uses a real diffusio
47
  segmind/SSD-1B + latent-consistency/lcm-lora-ssd-1b
48
  ```
49
 
50
- SSD-1B is an Apache-2.0 distilled SDXL model. The LCM adapter reduces generation to four denoising steps. The weights run inside the Space's ZeroGPU allocation, so the app does not consume Hugging Face Inference Provider credits and does not require a paid image API.
51
 
52
- Sprites and backgrounds both use image-to-image generation from deterministic, perspective-specific guides. Sprite guides also carry the requested palette on a clean white field before transparency extraction; this prevents the model from reverting to a front-facing pose or adding scenery around an isolated sprite. Background guides encode top-down, side-view, or isometric geometry instead of relying on prompt wording alone. Background negative prompts reject characters and generic particle overlays; the procedural lava guide no longer contains the circular effects that previously appeared as repeated particles.
53
 
54
- The deployed Space is fail-closed: if the primary neural model cannot run, generation stops with a visible error instead of silently returning procedural art and calling it model output. The procedural renderer remains available for local development and emergency diagnostics only.
55
 
56
  ZeroGPU is free for eligible personal accounts, but it is quota-limited rather than unlimited: free accounts currently receive five minutes of GPU time per day. Queueing or a quota message is therefore possible even though no inference credits or payment are required.
57
 
@@ -65,8 +65,6 @@ PRIMARY_LORA_MODEL=latent-consistency/lcm-lora-ssd-1b
65
  PRIMARY_IMAGE_STEPS=4
66
  PRIMARY_SPRITE_STEPS=6
67
  PRIMARY_GUIDANCE_SCALE=1.5
68
- PRIMARY_BACKGROUND_STRENGTH=0.72
69
- PRIMARY_SPRITE_STRENGTH=0.82
70
  ```
71
 
72
  `HF_TOKEN` is not required to download these public image models. It remains useful for the optional prompt-model provider and for the UI's token-validity check.
@@ -95,7 +93,7 @@ HF_TOKEN=<Space secret with Inference Providers permission>
95
 
96
  This sends the deterministic background as an image-to-image layout reference and asks the model to preserve its projection and walkable geometry. `FLUX.2-klein-4B` is available through a Hugging Face Inference Provider. This option is disabled by default because provider calls consume account inference credits; it is not needed for the free ZeroGPU pipeline.
97
 
98
- The older text-to-image fallback remains opt-in through `USE_HF_IMAGE_PROVIDER=1` and `HF_IMAGE_MODEL` (default `black-forest-labs/FLUX.1-schnell`). Unlike the structure-refinement tier, text-to-image receives no layout image and is therefore the weakest model option for strict camera compliance.
99
 
100
  When running locally with `REQUIRE_PRIMARY_IMAGE_MODEL=0`, model failure may fall back to the style-aware Pillow renderer for development. The public Space should keep the requirement enabled so its generated images are provably model-backed.
101
 
 
33
 
34
  The UI reports the configured prompt and image pipeline and labels every role with its actual source. Every asset carries a normalized camera contract (`top_down`, `side_view`, `isometric`, `first_person`, or `front_view`). Top-down background prompts explicitly forbid a sky, horizon, eye-level view, and front-facing facades.
35
 
36
+ The public production path uses diffusion rather than procedural drawing. Diffusion provides much better open-ended subject and style fidelity but can still miss perspective, background, or edge constraints; sprite outputs therefore receive alpha post-processing and still require visual approval. Background and sprite diffusion runs use different negative prompts so valid characters and vehicles are not accidentally excluded from sprite generation. A procedural renderer remains available only for local development when fail-closed production mode is disabled.
37
 
38
  The app combines the game type, perspective, theme, and pasted code into explicit per-role image prompts, then generates PNG assets and embeds contract-compatible assets as base64 data URIs.
39
 
 
47
  segmind/SSD-1B + latent-consistency/lcm-lora-ssd-1b
48
  ```
49
 
50
+ SSD-1B is an Apache-2.0 distilled SDXL model. The LCM adapter enables low-step generation. The weights run inside the Space's ZeroGPU allocation, so the app does not consume Hugging Face Inference Provider credits and does not require a paid image API.
51
 
52
+ Sprites and backgrounds are generated directly from their written prompts. No procedurally drawn sprite, palette, silhouette, camera guide, or background layout is passed into the production model. Camera perspective is enforced through explicit positive and negative prompt contracts. Background negative prompts reject characters and generic particle overlays, while sprite prompts request a complete subject on a uniform white field for later transparency extraction.
53
 
54
+ The deployed Space is fail-closed: if the primary neural model cannot run, generation stops with a visible error instead of silently returning procedural art and calling it model output. The procedural renderer remains available for local development and diagnostics only and cannot influence successful public generations.
55
 
56
  ZeroGPU is free for eligible personal accounts, but it is quota-limited rather than unlimited: free accounts currently receive five minutes of GPU time per day. Queueing or a quota message is therefore possible even though no inference credits or payment are required.
57
 
 
65
  PRIMARY_IMAGE_STEPS=4
66
  PRIMARY_SPRITE_STEPS=6
67
  PRIMARY_GUIDANCE_SCALE=1.5
 
 
68
  ```
69
 
70
  `HF_TOKEN` is not required to download these public image models. It remains useful for the optional prompt-model provider and for the UI's token-validity check.
 
93
 
94
  This sends the deterministic background as an image-to-image layout reference and asks the model to preserve its projection and walkable geometry. `FLUX.2-klein-4B` is available through a Hugging Face Inference Provider. This option is disabled by default because provider calls consume account inference credits; it is not needed for the free ZeroGPU pipeline.
95
 
96
+ An API-backed text-to-image alternative remains opt-in through `USE_HF_IMAGE_PROVIDER=1` and `HF_IMAGE_MODEL` (default `black-forest-labs/FLUX.1-schnell`). It receives no layout image and consumes Hugging Face Inference Provider credits.
97
 
98
  When running locally with `REQUIRE_PRIMARY_IMAGE_MODEL=0`, model failure may fall back to the style-aware Pillow renderer for development. The public Space should keep the requirement enabled so its generated images are provably model-backed.
99