[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-114941":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":9,"pushedAt":36,"updatedAt":37,"readmeContent":38,"aiSummary":39,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":40,"discoverSource":41},114941,"z-image-turbo-pascal-4gb","alexturkey\u002Fz-image-turbo-pascal-4gb","alexturkey","Sınırsız Foto: Z-Image-Turbo (Q8_0, full quality) on a 4 GB GTX 1050 Ti laptop with 16 GB RAM. stable-diffusion.cpp + cuDNN VAE, Windows, every number measured. Unofficial. Not affiliated with Tongyi-MAI, leejet or NVIDIA.",null,"Python",198,40,1,2,0,3,82,18,79.04,"Apache License 2.0",false,"main",[24,25,26,27,28,29,30,31,32,33,34,35],"4gb-vram","cuda","cudnn","gguf","gtx-1050-ti","local-ai","low-vram","nvidia-pascal","stable-diffusion-cpp","text-to-image","z-image","z-image-turbo","2026-11-23 06:09:44","2026-11-23 17:05:50","[Türkçe](README.tr.md) · **English** · [Deutsch](README.de.md) · [Français](README.fr.md) · [Español](README.es.md) · [Italiano](README.it.md) · [Português](README.pt.md) · [Русский](README.ru.md) · [Polski](README.pl.md) · [Nederlands](README.nl.md) · [Dansk](README.da.md) · [Norsk](README.nb.md) · [Svenska](README.sv.md) · [Suomi](README.fi.md) · [Ελληνικά](README.el.md) · [العربية](README.ar.md) · [עברית](README.he.md) · [हिन्दी](README.hi.md) · [中文](README.zh.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [ไทย](README.th.md) · [Tiếng Việt](README.vi.md) · [Bahasa Indonesia](README.id.md) · [Bahasa Melayu](README.ms.md) · [Tagalog](README.tl.md) · [မြန်မာ](README.my.md) · [ខ្មែរ](README.km.md) · [ລາວ](README.lo.md) · [Kiswahili](README.sw.md)\n\n# Sınırsız Foto\n\n**Z-Image-Turbo (Q8_0 GGUF) text-to-image at 768x1344 on a 4 GB GTX 1050 Ti (Pascal, sm_61), with stable-diffusion.cpp, on Windows.** Measured on a 16 GB RAM laptop, where the process uses about 11 GB of RAM. The same seed gives the same pixels, pixel for pixel; the measurements and the engine patches are published, the downloads are pinned with sha256, and an AI coding agent can install it step by step.\n\n*Unofficial. Not affiliated with Tongyi-MAI (Z-Image), leejet (stable-diffusion.cpp) or NVIDIA.*\n\n## Start here\n\nA ready-made package exists, so try it first. If your hardware is different or a step fails, everything else is open: the patches, the build recipe and the measurements are in this repository, so you can build for your own card or adapt them.\n\n```\n1. nvidia-smi --query-gpu=name,memory.total --format=csv\n      expect a line like: NVIDIA GeForce GTX 1050 Ti, 4096 MiB\n      NVIDIA card with 4 GB, Windows x64 -> 2        anything else -> 5\n2. python scripts\u002Fsetup.py\n      downloads NVIDIA cuDNN by default (NVIDIA's license applies); add --no-cudnn to skip it; both work\n      expect the last line: SETUP_OK\n3. python scripts\u002Fgenerate.py --prompt-file prompts\u002Feiffel.txt\n      expect the last line: IMAGE_OK \u003Cpath>\n4. Open \u003Cpath>. Done. Compare your numbers: docs\u002FMEASUREMENTS.md\n5. Other hardware, or a step failed: everything is open.\n      patches\u002FREADME.md   docs\u002FBUILD.md   docs\u002FMEASUREMENTS.md   docs\u002FTROUBLESHOOTING.md\n      Build the engine for your card, or adapt the recipe. AGENTS.md has the exact steps.\n```\n\nStep 2 downloads about 12.2 GB and took 29 minutes once, on our connection; it first prints a \"Preflight\" block (your GPU, RAM and free disk next to what we measured; it only informs).\nOnly the GTX 1050 Ti 4 GB laptop card (Pascal, compute capability 6.1) was measured. Other cards were not tested.\nIf you use an AI coding agent (Claude Code, Codex, Cursor and similar), point it at [`AGENTS.md`](AGENTS.md).\n\n## At a glance\n\nAgainst the v0.1.0 layout: a picture takes 193–228 s instead of 261.6 s, the VAE stage takes 8.3–15.9 s instead of 29.8 to 36.3 s, the same seed gives the same pixels, and every number in this README has a command and a file behind it.\n\n768x1344, seed 42, 8 steps, same machine. v0.1.0 numbers are from the v0.1.0 README (clean-root test and five runs); v0.2.0 numbers are from the clean-root test of this release.\n\n| | v0.1.0 (never published; old layout) | v0.2.0 |\n|---|---|---|\n| Time for one picture (one `generate.py` run) | 261.6 s | 193–228 s |\n| VAE decode (last stage) | 29.8 to 36.3 s | 8.3–15.9 s |\n| Closeness to a reference decode (PSNR, higher is better) | 38 to 43 dB | 71 to 73 dB |\n| Peak GPU memory (nvidia-smi) | 2949 to 2957 MiB | 3057–3059 MiB |\n| Process memory, peak | 10.5 to 10.9 GB (as recorded then) | 10 667–10 915 MiB |\n| Lowest free RAM seen | 331 to 576 MiB | 418–545 MiB |\n\nHow to read this: the reference is the same latent decoded on the CPU as one float32 piece; PSNR compares our GPU decode with it (3 pictures). It says how close the VAE stage is to that reference. It does not say how good a picture looks. The v0.2.0 pictures are not byte-identical to v0.1.0 for the same prompt and seed, because the VAE path changed on purpose. Method and the unmeasured parts: [`docs\u002FMEASUREMENTS.md`](docs\u002FMEASUREMENTS.md).\n\n## Examples\n\n**AI-generated with this repo** (Z-Image-Turbo Q8_0, seed 42, 8 steps). These are not real photographs; landmarks and details\nmay be inaccurate, and a picture does not always follow its prompt in every detail. The exact prompts are in [`prompts\u002F`](prompts) and [`docs\u002FPROMPTS.md`](docs\u002FPROMPTS.md).\n\n| | | |\n|---|---|---|\n| ![Eiffel Tower at golden hour](docs\u002Fexamples\u002Feiffel.jpg) | ![Turkish tea glass](docs\u002Fexamples\u002Fturkish_tea.jpg) | ![Elderly fisherman](docs\u002Fexamples\u002Ffisherman.jpg) |\n| `prompts\u002Feiffel.txt`, 768x1344 | `prompts\u002Fturkish_tea.txt`, 768x1344 | `prompts\u002Ffisherman.txt`, 768x1344 |\n| ![Hillside village](docs\u002Fexamples\u002Fvillage.jpg) | | |\n| `prompts\u002Fvillage.txt`, 768x1344 | | |\n\n![Istanbul from the air](docs\u002Fexamples\u002Fistanbul_aerial.jpg)\n\n`prompts\u002Fistanbul_aerial.txt`, 1344x768. Not a real photo; landmarks may be inaccurate.\n\n## Quick start\n\nRequirements: Windows 10\u002F11, an NVIDIA GPU with 4 GB, a driver that supports CUDA 12.8 (driver 581.29 was measured; older drivers were not tested; the CUDA runtime itself is downloaded for you), Python 3.10 or newer,\ngit, about 14 GB free disk (downloads are about 12.2 GB with cuDNN; the free-disk figure is an estimate), and 16 GB RAM (what was measured; less is not tested).\n\n```powershell\ngit clone https:\u002F\u002Fgithub.com\u002Falexturkey\u002Fz-image-turbo-pascal-4gb.git\ncd z-image-turbo-pascal-4gb\npython scripts\u002Fsetup.py\npython scripts\u002Fgenerate.py --prompt-file prompts\u002Feiffel.txt\n```\n\n- `setup.py` first prints a \"Preflight\" block (your GPU, RAM and free disk next to what we measured; it only informs and never blocks). It then downloads from the pinned addresses in [`models.lock.json`](models.lock.json) and checks every file with sha256. It prints `MODEL_OK \u003Cname>`, `ENGINE_OK`, `CUDART_OK`, then `CUDNN_OK` or `CUDNN_SKIPPED`, and finally `SETUP_OK`.\n  Without `--models-dir` and `--bin-dir` it uses `models\u002F` and `bin\u002F` in the repo root; put the models on an SSD (only an SSD was measured).\n  Stop it any time with Ctrl+C and run the same command again: downloads continue from `.part` files.\n- **cuDNN is installed by default and is not part of this repository.** It is NVIDIA software under NVIDIA's own license ([license text](https:\u002F\u002Fdocs.nvidia.com\u002Fdeeplearning\u002Fcudnn\u002Fbackend\u002Flatest\u002Freference\u002Feula.html)), for systems with NVIDIA GPUs. It downloads from NVIDIA's server without payment or sign-in, and we found no clause in the license that limits commercial or personal use. `setup.py` prints the license address, downloads the file and copies only eight DLLs next to `sd-cli.exe`. NVIDIA's license says that whoever does not accept its terms must not download, install or use it; in that case run `python scripts\u002Fsetup.py --no-cudnn`. Without cuDNN everything works with the slower v0.1.0 VAE path (`--vae legacy`), and `generate.py` says so.\n- `generate.py` writes `outputs\u002F\u003CYYYYmmdd_HHMMSS>_\u003Cname>\u002Fimage.png`, `run.json` (time, stages, which VAE path ran, peak GPU memory, the exact command) and `log.txt`, and prints `IMAGE_OK \u003Cpath>`.\n\n## Usage\n\n```powershell\npython scripts\u002Fgenerate.py --prompt \"A lighthouse on a cliff at dawn, realistic photograph\"\npython scripts\u002Fgenerate.py --prompt-file prompts\u002Feiffel.txt --width 1344 --height 768 --seed 7 --vae auto\n```\n\n| Option | Meaning |\n|---|---|\n| `--prompt \"\u003Ctext>\"` or `--prompt-file \u003Ctxt>` | the prompt (one of the two is required) |\n| `--width`, `--height` | multiples of 16, 256 to 2048; default 768x1344; tested: 768x1344, 1344x768, 1024x1024 |\n| `--seed` | default 42 |\n| `--out`, `--name` | output folder root (default `outputs\u002F`) and a short name for the run folder |\n| `--models-dir`, `--bin-dir` | where `setup.py` put the models and the engine |\n| `--vae auto` (default) | cuDNN float32; try one piece first, then two large tiles, then the small default tile |\n| `--vae tiled` | cuDNN float32, always two large tiles |\n| `--vae legacy` | the v0.1.0 path: no cuDNN, small tiles. Used automatically (with a warning) when the cuDNN DLLs are missing |\n\nSteps (8), cfg (1.0), sampler and scheduler are fixed on purpose; see [What it runs](#what-it-runs).\n\n## Check it yourself\n\n- `generate.py` prints `PIXEL_SHA256 \u003Chex>` as one of its last lines: a hash of the decoded pixels. Run the same command twice and compare the two pictures: `python scripts\u002Fcompare.py \u003Crun A>\u002Fimage.png \u003Crun B>\u002Fimage.png` should print `SAME_PIXELS`.\n- The `PIXEL_SHA256` of the five examples on our machine is in [`docs\u002FMEASUREMENTS.md`](docs\u002FMEASUREMENTS.md). The file hash of a PNG can differ even when the pixels are the same, because the PNG carries the generation parameters as text; compare pixels, not files.\n- Honest limit: we did not measure whether another card or driver gives the same pixels.\n\n## Why it fits in 4 GB\n\n- **What the model authors say.** The Z-Image-Turbo model card says the model \"fits comfortably within 16G VRAM consumer devices\" ([model card](https:\u002F\u002Fhuggingface.co\u002FTongyi-MAI\u002FZ-Image-Turbo)). That is a statement about 16 GB cards. The official README also lists stable-diffusion.cpp as a third-party option and quotes it for \"as little as 4GB of VRAM\" ([README](https:\u002F\u002Fgithub.com\u002FTongyi-MAI\u002FZ-Image)); that is a claim of the stable-diffusion.cpp project, not a requirement of the Z-Image team.\n- **What we measured.** Z-Image-Turbo Q8_0 (a 6.6 GB file) with a Qwen3-4B Q8_0 text encoder, 768x1344: the GPU peak, sampled by nvidia-smi every 2 s (a short spike can be missed), was 2949 to 2957 MiB (v0.1.0 engine) and 3057–3059 MiB (v0.2.0 engine) on a 4096 MiB card. The weights (10 509 MiB; the engine log prints it as MB) stay in system RAM; the engine copies the network to the GPU one segment (a slice of the network) at a time: 36 segments, as in the log line `z_image using 36 segments`.\n- **What it costs.** Time and system memory: 193–228 s per picture, and the engine process holds about 10 667–10 915 MiB of RAM (memory-mapped model pages included) on a 16 GB machine, so free RAM drops to a few hundred MiB while it runs.\n- **Other people's setups.** Others report Z-Image on 4 GB cards with lower quantization or smaller sizes (for example the stable-diffusion.cpp wiki page for 4 GB cards recommends Q3_K or Q4_0 at 1024x512). Where we looked (list and date in [`docs\u002FRELATED.md`](docs\u002FRELATED.md)) we did not find a published setup that combines all four: a 4 GB card, Q8_0, 768x1344 or larger, and measured time and GPU memory. That is a statement about where we looked, not about everywhere.\n- **Who does what.** Fitting into 4 GB comes from stable-diffusion.cpp itself: `--offload-to-cpu`, `--mmap`, working in slices, and flash attention (with it off, a run needed 4205 MB and did not fit). Our patches are for speed and for a better VAE stage, not for fitting. We did not run the unpatched upstream engine on this card, so we cannot say whether it fits.\n\n## How it works\n\nThree changes on top of stable-diffusion.cpp `master-1088-32d516c` (all are switches; the table in [`patches\u002FREADME.md`](patches\u002FREADME.md) lists each one with its environment variable):\n\n1. **The refiner runs once per step.** A group name was used twice, so four refiner blocks were computed a second time. Fixing it makes steps 2 to 8 about 1.3 s faster each (22.0 to 20.7 s) with a pixel-identical picture (3 pictures checked).\n2. **VAE through cuDNN, in float32.** The last stage (turning the latent into pixels) now uses NVIDIA's cuDNN float32 convolution. On our card it took the VAE from 23 to 27 s to 10 to 15 s and moved the PSNR against the reference from 38 to 43 dB to 45 to 49 dB (large tiles).\n3. **One piece first.** The engine now tries to decode the whole image in one piece when the memory check says it fits (margin 256 MiB), falls back to two large tiles, and then to small tiles. In one piece the VAE took about 8–16 s and the PSNR against the reference was 71 to 73 dB. If a forced fallback happens, the picture has the same pixels as the tiled one (checked with `PIXEL_SHA256`). What happened is written in `run.json` (`stages.vae_path`: `full`, `tile`, `floor` or `retry`).\n\nAlso: `--eager-load` (reads the model pages up front; 241.2 s to 220.3 s on the same picture, development build, one run each) is part of the fixed command.\n\n\u003Ca id=\"what-it-runs\">\u003C\u002Fa>\n## What it runs\n\n| Part | File | Source |\n|---|---|---|\n| Diffusion model | `z_image_turbo-Q8_0.gguf` (6,577,440,704 B) | [leejet\u002FZ-Image-Turbo-GGUF](https:\u002F\u002Fhuggingface.co\u002Fleejet\u002FZ-Image-Turbo-GGUF), base [Tongyi-MAI\u002FZ-Image-Turbo](https:\u002F\u002Fhuggingface.co\u002FTongyi-MAI\u002FZ-Image-Turbo) |\n| Text encoder | `Qwen3-4B-Instruct-2507-Q8_0.gguf` (4,280,405,600 B) | [unsloth\u002FQwen3-4B-Instruct-2507-GGUF](https:\u002F\u002Fhuggingface.co\u002Funsloth\u002FQwen3-4B-Instruct-2507-GGUF) |\n| VAE | `ae.safetensors` (335,304,388 B) | [Comfy-Org\u002FZ-Image-Turbo](https:\u002F\u002Fhuggingface.co\u002FComfy-Org\u002FZ-Image-Turbo), FLUX.1-type autoencoder |\n| Engine | `sd-cli.exe`, stable-diffusion.cpp `32d516c` with the patches in [`patches\u002F`](patches) | the v0.2.0 release of this repository (`sinirsiz-foto-engine-v0.2.0-win-x64-cuda12.8-sm61.zip`) |\n| CUDA runtime | `cudart`, `cublas`, `cublasLt` (12.8), unmodified | zip from the wan22-pascal-4gb v0.1.0 release |\n| cuDNN (installed by default; `--no-cudnn` skips it) | 8 DLLs, version 9.10.2.21 (CUDA 11 build) | NVIDIA's own server, under NVIDIA's license; not stored here |\n\nFixed settings: `--cfg-scale 1.0 --steps 8 --sampling-method euler --scheduler simple --offload-to-cpu --mmap --eager-load --flash-attn on`.\nWe do not lower the steps, add a negative prompt or enable caching: the model is distilled for 8 steps and does not use negative prompts (see [prompts](docs\u002FPROMPTS.md)).\n\n## Limits (read before you rely on it)\n\n- **Windows only.** The prebuilt engine and these scripts are Windows only.\n- **One card, one machine.** Measured only on a GTX 1050 Ti 4 GB laptop (i7-7700HQ, 16 GB RAM, Windows 10, driver 581.29, models on an SSD). Other GPUs and drivers, machines with less than 16 GB RAM, Linux and macOS: **not tested by us**.\n- Other cards and systems (which path exists, and a community test on an AMD card under Linux that we did not run ourselves): [docs\u002FOTHER_GPUS.md](docs\u002FOTHER_GPUS.md).\n- **The engine is built for Pascal (sm_61) only.** Other architectures need a build of your own ([`docs\u002FBUILD.md`](docs\u002FBUILD.md)); we did not test one.\n- **cuDNN:** we measured with the CUDA 11 build of cuDNN 9.10.2.21. The CUDA 12 build has different files and was not measured.\n- **Memory is tight.** Free RAM falls to a few hundred MiB; close other programs, run one picture at a time. We have not seen GPU memory run out after the engine's memory check passed, and we did not test what happens then.\n- **Sizes:** only 768x1344, 1344x768 and 1024x1024 were tested. Bigger sizes print a warning and may run out of memory.\n- Prompt fidelity is partial: a picture does not always follow its prompt in every detail. Text inside pictures and real-world landmarks were not evaluated.\n- The PSNR reference is our own engine's CPU decode, not an independent implementation.\n- Numbers in [`docs\u002FMEASUREMENTS.md`](docs\u002FMEASUREMENTS.md) come from one run each unless it says otherwise.\n\n## License and credit\n\n- This repository's scripts and documents: [Apache-2.0](LICENSE) with a [`NOTICE`](NOTICE) file. The engine patches in [`patches\u002F`](patches) are MIT, like the code they modify.\n- stable-diffusion.cpp and ggml are MIT. Notices for the third-party code compiled into the engine are in [`licenses\u002F`](licenses) and [`THIRD_PARTY.md`](THIRD_PARTY.md).\n- Model files are not stored here; they are downloaded from the sources above under their own licenses (Hugging Face lists Apache-2.0 for all of them, read on 2026-11-13). The model card says nothing about who owns generated pictures, and we make no claim about it.\n- **cuDNN and the CUDA runtime are NVIDIA's property** and are not under this repository's license. cuDNN is downloaded from NVIDIA's server under NVIDIA's license (`--no-cudnn` skips it); the CUDA runtime DLLs are in a separate unmodified zip (CUDA Toolkit EULA, Attachment A). Details and what we could not verify: [`THIRD_PARTY.md`](THIRD_PARTY.md).\n- **Credit.** Keeping the `NOTICE` file with copies and derived works is the condition (Apache-2.0, section 4). Beyond that, a line such as \"Based on Sınırsız Foto by Ali Haydar Öztürk (Ozturk), https:\u002F\u002Fgithub.com\u002Falexturkey\" is appreciated, not required.\n- Please read [`ETHICS.md`](ETHICS.md): every picture is synthetic, and you are responsible for what you publish.\n\n## Contributing\n\nThe most useful thing you can do is **test your card** and tell us what happened: GPU name, driver, RAM, the `run.json` and the last lines of the log (the \"Hardware test report\" issue form). Fixes to the documents and to the scripts are welcome too; see [`CONTRIBUTING.md`](CONTRIBUTING.md). Security reports go through the private route in [`SECURITY.md`](SECURITY.md).\n\n[Install guide for AI agents](AGENTS.md) · [Measurements](docs\u002FMEASUREMENTS.md) · [Troubleshooting](docs\u002FTROUBLESHOOTING.md) · [Building the engine](docs\u002FBUILD.md) · [Patches](patches\u002FREADME.md) · [Prompts](docs\u002FPROMPTS.md) · [Third-party](THIRD_PARTY.md) · [Changelog](CHANGELOG.md)\n","这是一个面向低显存设备（特别是4GB显存的GTX 1050 Ti）优化的本地文本生成图像（text-to-image）推理方案，基于stable-diffusion.cpp与cuDNN加速的VAE解码器，支持Q8_0量化GGUF模型（Z-Image-Turbo），在Windows系统上实现全精度输出。核心特点是显存占用可控（实测稳定占用约4GB GPU内存）、结果可复现（同种子像素级一致）、全流程可验证（所有测量数据、补丁和构建步骤均开源公开）。适用于显存受限但需离线运行Stable Diffusion类模型的个人开发者、边缘AI实验者及轻量级本地AI创作场景。","2026-11-24 04:49:51","CREATED_QUERY"]