Commit Graph
4 Commits
Author SHA1 Message Date
limbicnation f0aaf1314a Free Ollama VRAM after node execution
Pass keep_alive="0s" on every Ollama generate call so models are
evicted from GPU VRAM immediately instead of lingering 5 minutes,
which caused CUDA OOM when downstream diffusion models loaded.

Each node now runs async VRAM cleanup in a try/finally block. The
cleanup uses unload=True so it also evicts a model loaded via the
subprocess fallback path (which carries the default keep_alive).

Add unload_model(), release_vram(), cleanup() and cleanup_async()
to OllamaClient, plus a per-node unload toggle on PromptRefiner.
2026-06-23 04:21:47 +02:00
limbicnation ebbb25a2a3 Add dual-stream prompt refiner node
Add PromptDualStreamRefinerNode that produces a positive and negative
prompt pair in a single pass via Ollama, intended for the shipped Q8
GGUF of qwen2-5-7b-dual-stream-prompt-lora. Reuses OllamaClient for
streaming, timeouts, progress, and llama-runner crash handling, and
parses Positive/Negative output defensively across label variants.

Includes config/Modelfile.dualstream, unit tests, node registration,
and a corrected implementation plan replacing the invalid local
transformers/PEFT approach.
2026-06-10 22:10:16 +02:00
limbicnation 52dcfbcb17 fix: address PR #8 review issues
- Fix _weighted_average deduplication bug (now uses weight-ratio emphasis markers)
- Replace bare except Exception with specific exception handling in OllamaClient
- Propagate API contract mismatches (TypeError/AttributeError) as RuntimeError
- Replace print() with logging.getLogger(__name__) in all new nodes
- Expose top_p in PromptRefinerNode INPUT_TYPES for consistency
- Update PR-8-REVIEW.md with fix log and merge recommendation
2026-04-28 05:01:03 +02:00
limbicnation 89c8341612 feat: add prompt chain nodes + test infrastructure
Phase 1 — Foundation Hardening:
- Extract ollama_client.py adapter from PromptGeneratorNode
- Add pytest suite (29 tests, 70% coverage gate)
- Unify style sources into config/styles.yaml
- Extend CI with pytest + coverage

Phase 2 — Prompt Chain Nodes:
- PromptRefinerNode: iterative LLM refinement (1-3 passes)
- NegativePromptNode: style-aware negative prompt generation
- PromptCombinerNode: blend/concat/weighted_average modes

New graph target:
  PromptGenerator -> PromptRefiner -> PromptCombiner -> CLIP
                          ^
  NegativePrompt ---------+

Closes roadmap phases 1.1-2.3
2026-04-27 07:00:58 +02:00