Skip to content

Lofn: An award-winning, open-source AI art generator that combines Tree of Thoughts prompting and critic/artist refinement to create unique, high-quality artwork. Supports Midjourney, DALL-E 3, and Discord integration. Built with OpenAI and Anthropic's Claude.

License

Notifications You must be signed in to change notification settings

LocalSymmetry/lofn

Repository files navigation

Lofn AI — Agentic Art 🎨 · Music 🎵 · Video 🎬 Framework

One‑sentence idea ➜ contest‑topping prompt ➜ (optional) generated media — autonomously.

GitHub Stars GitHub Forks Last Commit License Docker Ready


👥 Follow Us  (all channels updated 2025‑07)

Platform Link
NightCafe (Art) https://creator.nightcafe.studio/u/LocalSymmetry
Suno (Music) https://suno.com/@localsymmetry
YouTube (Music) https://youtube.com/channel/UCcoAFyeiMwzSb24iVml9wSA
YouTube (AI Demos) https://youtube.com/@lofnai
Spotify https://open.spotify.com/artist/3egvpGmWFxgYY8XqATui8r
Apple Music https://music.apple.com/us/artist/local-symmetry
Boomplay https://www.boomplay.com/artists/111995625
Instagram https://www.instagram.com/local.symmetry
TikTok https://www.tiktok.com/@lofn.ai

🏆 Awards Showcase (2024 – 25)

Full‑resolution PNGs are in /examples, each named community‑challenge‑<id>.png.

Detailed Placements

Title Challenge Placement Field Size NightCafe Link
Petals Kiss the Tide Flowers 🥇 1st 1 910 MoEhHHLb
Being Devoured by the Role Female Portraits 🥇 1st 673 lKMuiIeK
Can’t Figure the Way Forward No Theme (Uploads) 🥇 1st 869 a4ww4P3K
Enchanted Dark Fairy Perches on Crescent Moon Crescent Fae 🥇 1st 459 mL9iwog1
Stylish Attire Stylish Attire 🥈 Runner‑up BDkppU9l
Green Green 🥈 2nd 348 1J5idcZk
Dangerous Bap Target Biomechanical Creature 🥈 2nd 430 6H3ljL30
Constellation of Gilded Dreams Gilded Dreams 🥈 2nd ZoeZJBLN
Esteemed Opulance Opulence 🥈 2nd rW6e9QTP
Mosaic Sea Radiant Sea 🥉 3rd 512 q7X2vFvy

Other Notable Victories

  • 🥇 Whirl Daily Art Competition – first place (“Only This and Nothing More”).
  • 🥈 Whirl Discord Art Challenge – second place (“A Victorian Chrononaut”).

Whirl images live in /examples (Only this...jpeg, 2nd_A Victorian Chrononaut...png).


🔑 Key Features

Cluster Highlights
Reasoning Core Tree‑of‑Thoughts search + iterative Artist ⇄ Critic loop
Steerability 10 Style Axes, Creativity Spectrum sliders, persistent Personality DNA
Expert Panels Automatic or user‑selected 6 experts + 1 devil’s advocate debate each branch
Multi‑Modal Image, Music, Video
TikTok Mode FLUX Pro v1.1 Ultra 9:16 images rotated for Veo 3 ingestion
Competition Mode Shrinks the prompt to platform limits while preserving nuance; injects Panel + Personality context first
Model‑Agnostic Works with OpenAI, Anthropic, Google Gemini, Meta Llama, and any OpenAI‑compatible local LLM (via Ollama, text‑gen‑webui, etc.)
Nano Banana Gemini 2.5 Flash Image preview for Gemini‑powered image generation
Phase‑Map Transparency A visible flowchart of every stage, emitted with each run
Ethics & Provenance Strong NSFW/harassment filters + anti-copyright infringement checks
Discord & Webhooks Push prompts or rendered assets straight to any channel

📚 Table of Contents

  1. Quick Start
  2. Installation   •  Configuration
  3. Usage
  4. Concept → Prompt Pipeline
  5. Style Axes   •  Personality
  6. Panels   •  Modes
  7. Model Coverage
  8. Ethics & Provenance
  9. FAQ   •  Contributing   •  License

🏁 Quick Start (in 60 s)

# 1 · Clone
git clone https://github.com/LocalSymmetry/lofn.git && cd lofn

# 2 · Create config & add API keys
cp config.yaml.example config.yaml          # then edit

# 3 · Docker (up‑to‑date CUDA & ffmpeg baked in)
docker build -t lofn .
docker run -p 8501:8501 \
  -v $(pwd)/images:/images \
  -v $(pwd)/videos:/videos \
  -v $(pwd)/music:/music \
  -v $(pwd)/metadata:/metadata \
  lofn

# 4 · Open
open http://localhost:8501

🛠️ Installation

Prerequisites

  • Docker 24+ (or native Python 3.11 / Poetry if you prefer)
  • GPU with 8 GB+ VRAM recommended for on‑device Stable Diffusion / video renders
  • API keys for at least one text model (OpenAI, Claude, Gemini…) or a local LLM endpoint

Alternative: Native (Python)

poetry install --with=dev
export OPENAI_API_KEY=...
streamlit run app.py        # identical UI to Docker image

⚙️ Configuration

Only keys & endpoints live in config.yaml:

OPENAI_API_KEY:      ""
ANTHROPIC_API_KEY:   ""
GOOGLE_API_KEY:      ""    # Gemini / Imagen 3
OPEN_ROUTER_API_KEY: ""
POE_API_KEY:         ""
FAL_API_KEY:         ""    # Flux 1 / SDXL
RUNWAY_API_KEY:      ""    # Gen‑3 Alpha
DISCORD_WEBHOOK_URL: ""
LOCAL_LLM_API_BASE:  ""    # e.g. http://localhost:11434/v1
LOCAL_LLM_API_KEY:   ""
GCP_PROJECT_ID:      ""
GCP_LOCATION:        ""

LLM start-up priorities live in lofn/model_defaults.yaml. Each mode (art, video, music) defines a preferred list for concept/medium generation and for final prompt synthesis. Lofn will attempt to use the first available model from each list when a mode is selected, falling back to the built-in order if none of the preferred models are accessible. These preferred models also appear at the top of the model selectors when present.

All behavioural constants sit in lofn/constants.py (tree widths, critic weights, etc.).


🎮 Usage

  1. Choose Mode (Art, Music, Video)
  2. Toggle Competition (optional)
  3. Generate Personality → then Select / Generate Panel
  4. Enter Idea — one sentence is enough
  5. Generate → Review concepts → Pick or iterate
  6. Copy Prompt or let Lofn call the generator API automatically

Raw prompts, images, audio and video are auto‑saved in /images, /music, /videos, with human‑readable JSON metadata for provenance.


🔍 Concept → Prompt Pipeline

flowchart TD
    A[User Idea] --> B[Panel & Personality Injection]
    B --> C[Meta‑Prompt]
    C --> D[Tree‑of‑Thoughts Expansion]
    D --> E[Artist Embellishment]
    E --> F[Critic Compression]
    F --> G[Synthesis & Ranking]
    G --> H[Ethics / Provenance Filter]
    H --> I[Competition Shrink]
    I --> J[Final Prompt]
    J --> K[Optional Render]
Loading

Each node including intermediate drafts is stored in /metadata with RFC‑3339 timestamps for auditability.


🎚️ Style Axes

# Axis 0 100
 1 Abstraction → Realism Cubist blur 4 K photoreal
 2 Desaturation → Vibrancy Monochrome Neon pop
 3 Minimal → Complex Single subject Hyper‑ornate
 4 Calm → Dramatic Soft focus High contrast
 5 Symmetry → Asymmetry Mirror‑perfect Chaotic skew
 6 Familiarity → Novelty Classical Surreal
 7 Soft → Hard Lines Watercolor Etching
 8 Warm → Cool Palette Sunset hues Arctic blues
 9 Static → Motion Still life Dynamic action
 10 Low → High Symbolism Literal Metaphoric overload

Change them in the sidebar or let Lofn auto‑infer from your concept.


🧬 Personality

A thematic setting that provides a consistent creator persona that lasts between generations.

Leave empty for LLM‑generated defaults or curate for brand consistency.

Custom personas can also be loaded from lofn/prompts/custom_personalities.yaml. Copy the provided custom_personalities.yaml.example file to this location and add your own entries to have them appear in the sidebar.


👥 Panels

Groups of 5 experts + 1 devil’s advocate simulate a live debate on every branch.

Options

Type Description
Preset Photography, Baroque, Cyberpunk Music, Screenwriting, …
LLM‑Generated Lofn fabricates domain experts on the fly
Custom Hand‑define names, bios & biases in panels.yaml

Any OpenAI‑compatible local LLM (Ollama, llama.cpp) works by setting LOCAL_LLM_API_BASE.


🛡️ Ethics & Provenance

  • OpenAI policy & Google Imagen safety filters enforced by default
  • Custom block‑lists for hateful or harassing content
  • Prompt hardening against copyright infringement
  • All prompts and generations logged locally for transparency

❓ FAQ

Expand

Q: Can I feed sketches or images as input? Yes. Upload up to five reference images to guide the generation.

Q: Why use Lofn over other prompt generators? Lofn was made to have the highest possible quality to win.

Q: How do I swap in a new model? Edit config.yaml (API key) and add a mapping in lofn/llm_integration.py. The prompt templates are model‑agnostic.


🤝 Contributing

  1. Open an Issue — bug, feature, or prompt tweak
  2. ForkBranch (feat/xyz)
  3. Code & Test (pytest, examples/cli_smoke_test.sh)
  4. PR — use Conventional Commits, fill template
  5. 🎉 Celebrate — we squash‑merge weekly

📝 License

Apache 2.0 — free for personal & commercial use, attribution appreciated.

About

Lofn: An award-winning, open-source AI art generator that combines Tree of Thoughts prompting and critic/artist refinement to create unique, high-quality artwork. Supports Midjourney, DALL-E 3, and Discord integration. Built with OpenAI and Anthropic's Claude.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages