Skip to content

Wontfallo/Wan2-2_Prompt_Generator

Repository files navigation

Wan 2.2 - FLUX - QWEN Prompt Generator

Wan2.2 - QWEN - FLUX Prompt Generator in ComfyUI

Wan2.2 - QWEN - FLUX Prompt Generator in ComfyUI

DESKTOP APP Single EXE made in PYTHON

Wan 2.2 Prompt Generator

This project aims to generate prompts using various parameters and models.

Features

  • Easy to use
  • Customizable parameters
  • Supports multiple models

Single HTML File just open the HTML DOC save as a book mark, all the same features!

Wan 2.2 One File HTML Prompter

Wan 2.2 Prompt Crafter

A desktop app for crafting high‑quality Wan 2.2 video prompts with a clean CustomTkinter UI, controllable creativity modes, and a persistent prompt history. Core UI and logic live in app.py and backend.py. The complete one‑shot spec is documented in UI_DESIGN_BLUEPRINT.md.

Quick Start (Windows EXE)

  • Built EXE path after packaging: dist\Wan2PromptCrafter.exe
  • Double‑click the EXE to launch the app.
  • For best results, have either LM Studio or Ollama running locally before generating prompts.

Notes:

  • History is automatically persisted to %APPDATA%\Wan2PromptGenerator\wan2_prompt_history.json (see get_history_file_path()).

Run From Source

Prereqs:

  • Python 3.10+
  • Windows recommended (packaging config targets Windows)

Install runtime dependencies:

  • pip install customtkinter requests clipboard

Run:

  • python app.py

Build a Portable EXE (PyInstaller)

The build is already proven with icon + splash:

  • python -m pip install --upgrade pyinstaller
  • pyinstaller --noconfirm --clean --onefile --windowed app.py --name "Wan2PromptCrafter" --icon "C:\Users\WontML\Pictures\1a\icon.png" --splash "C:\Users\WontML\Pictures\1a\icon.png" --exclude-module PyQt5 --exclude-module PyQt6

Result:

  • dist\Wan2PromptCrafter.exe

Optional size trim (when Qt or qtpy sneaks in via transitive deps):

  • Add: --exclude-module qtpy --exclude-module PySide2 --exclude-module PySide6

UI Overview

The application layout and behavior are fully specified in UI_DESIGN_BLUEPRINT.md. Implementation entry points:

  • Window setup and layout: Wan2PromptApp.init(), Wan2PromptApp.create_widgets()
  • History side panel (accordion): Wan2PromptApp.create_history_panel(), Wan2PromptApp.toggle_history_panel()

Config frame (3 rows), exact final layout:

  1. Services & Endpoint row (compact): app.py–app.py
  2. Model + Pull on one dense row with tight spacing: app.py–app.py
  3. Creativity row (two options, no truncation): app.py–app.py

Input / Output:

  • Input (blue) and Output split vertical space via grid weights: app.py–app.py
  • “Inspire Me” lives in the Input header (top‑right): app.py–app.py
  • “Generate Wan 2.2 Prompt” is the primary CTA between Input and Output: app.py–app.py
  • Output supports “Copy to Clipboard”: Wan2PromptApp.copy_output()

Negative Prompt (locked by default):

  • Frame + “Unlock to Edit” checkbox: app.py–app.py
  • Toggle logic: Wan2PromptApp.toggle_neg_prompt_edit()

LLM Backends

  • Creativity‑aware system prompt assembly: get_system_prompt()
  • Generate Prompt:
    • LM Studio (OpenAI chat‑compat): generate_prompt()
    • Ollama (/api/chat, non‑stream): generate_prompt()
  • Inspire Me:
    • Request 3 short scene ideas: get_inspiration_prompt(), get_inspiration()

Networking and threading:

  • All long jobs are threaded and UI updates are marshalled using .after(0, ...):
    • Refresh models: Wan2PromptApp.refresh_models()
    • Pull model: Wan2PromptApp.pull_model()
    • Generate: Wan2PromptApp.run_generation()
    • Inspire: Wan2PromptApp.run_inspiration()

History

Where:

  • %APPDATA%\Wan2PromptGenerator\wan2_prompt_history.json
    • Created on first write: get_history_file_path()

Operations:

  • Add: add_to_history()
  • Load: load_history()
  • Delete one: delete_from_history()
  • Clear: clear_history()
  • Export JSON/CSV: export_history()

UI:

  • Search and filter (service/model/creativity): app.py–app.py, app.py–app.py

Endpoints

Switching service updates defaults and pull controls visibility: Wan2PromptApp.update_ui_for_service()

Troubleshooting

  • “No models found”:

    • Ensure the service is running locally and the correct endpoint is in the API input (Row 0).
    • Press “⟳ Refresh” after starting the service. See refresh_models().
  • Packaging pulls in Qt (PySide/qtpy) unexpectedly:

    • Use additional excludes if the binary is too large:
      • --exclude-module qtpy --exclude-module PySide2 --exclude-module PySide6
  • Antivirus/SmartScreen warnings:

    • Common for unsigned EXEs. Sign the binary or keep it locally.
  • Tcl/Tk splash issues:

    • PyInstaller should embed Tcl/Tk data automatically (verified in the logs). If it fails, ensure Python’s tk/tcl is installed and not stripped.

Project Structure

  • app.py: UI, threading, history panel, and actions
  • backend.py: HTTP requests, prompt assembly, history I/O, exports
  • UI_DESIGN_BLUEPRINT.md: One‑shot implementation spec and visual layout contract
  • dist\Wan2PromptCrafter.exe: portable build output (after packaging)

License

No license specified. Add a LICENSE file if you intend to distribute.

Acknowledgements

  • CustomTkinter for modern dark‑themed Tk UI
  • LM Studio / Ollama for local LLM inference

One‑Click Builder (Windows)

  • Use the provided batch script to go from zero to EXE automatically:
    • Double‑click build_exe.bat
    • What it does:
      • Detects Python (prefers py, falls back to python). If not installed, downloads and silently installs Python 3.10.11 x64.
      • Ensures pip is available and upgraded.
      • Installs dependencies from requirements.txt (or a minimal set if the file is missing).
      • Runs PyInstaller with icon + splash + module excludes to produce dist\Wan2PromptCrafter.exe.
    • Icon/splash path assumed: C:\Users\WontML\Pictures\1a\icon.png. If the file is missing, the script builds without icon/splash and notifies you in the console.

Troubleshooting:

  • If Python installation just finished, the shell PATH may need a new session; the script attempts to refresh PATH heuristically. If it still cannot find python/py, close the terminal and run the batch again.
  • To reduce EXE size further, adjust excludes inside build_exe.bat.

TODO:

  • Add these wan2.2 prompt cheat sheet to the system prompt https://wan-22.toolbomber.com/

    Camera descriptions work best in landscape mode. The effects are less strong in vertical frames.

    Camera distance

    • extreme close-up shot - eyes only
    • close-up shot - head only
    • medium shot - head and upper body only
    • medium wide shot - medium shot of subject in wide angle frame
    • wide shot - shot of subject from a distance
    • wide-angle lens - shows more of the scene in a wide, distant shot
    • wide lens - similar to wide-angle with slightly distorted wide view

    Camera height / viewpoint

    • over-the-shoulder shot - camera is behind one of the people in frame, at shoulder level
    • high angle shot - camera is above the subject, looking down at subject
    • low angle shot - camera is below eye level of subject, usually about waist height
    • extreme low angle shot - camera is below waist level of subject
    • dutch angle shot - camera frame is tilted at an angle so left or right side is higher than the other
    • aerial shot - camera is high above the subject, at a distance
    • eye-level / waist-level / etc. - places camera height relative to subject

    Camera movement

    • camera pushes in for a close-up - camera view gets closer to subject
    • camera pulls back- camera view pulls away from subject
    • camera pans to the right/left - camera strafes right or left while pointing in same direction
    • camera tilts up/down - camera stays in place but tilts its view up or down
    • tracking shot - camera moves with the subject to preserve framing
    • arc shot - camera rotates around the subject, keeping subject in frame
    • handheld camera - camera is shaky and unsteady, moving wildly during scene

    Lighting

    • edge lighting - edges of objects are highlighted
    • top lighting / side lighting / underlighting - where is the light source relative to subject
    • silhouette lighting - light is behind subject, subject is a dark sillhouette
    • low contrast lighting - lighting is balanced across the whole frame
    • high contrast lighting - some parts of frame are much lighter or darker than others
    • dawn/sunrise/afternoon/night time - dictates color and warmth of light
    • hard lighting - details are in sharp relief because of lighting
    • soft lighting - details are smoothed with softer light effect
    • overcast lighting - low contrast, less color saturation
    • moonlight - dim, cool color lighting
    • daylight - bright sunshing lighting, also use "sunny lighting"

    Colors

    • warm colors - trending towards reds, oranges, yellows, more intense colors
    • cool colors - trending towards blues, greys, muted colors
    • saturated colors - more intense, vibrant colors
    • desaturated colors - less intense colors with a more even tone

    Time of Day

    • Sunrise Time
    • Night Time
    • Sunset Time
    • Dawn Time
    • Sunrise Time
    • Time-lapse

    Special Effects

    • Street Dance

About

use LMStudio or Ollama to create really effective Wan2.2 text/image-2-video prompts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published