← 返回
未分类 Key 中文

Memorable Image Generator

Science-backed image generation agent that scores and optimizes images for memorability using ResMem (Brain Bridge Lab, University of Chicago) before returni...
基于科学的图像生成代理,使用 ResMem(芝加哥大学 Brain Bridge Lab)在返回前对图像的可记忆性进行评分和优化。
kiwi-phantomworks
未分类 clawhub v1.0.1 1 版本 100000 Key: 需要
★ 0
Stars
📥 327
下载
💾 0
安装
1
版本
#latest

概述

Memorable Image Generator

Science-backed image generation that optimizes for memorability — not just aesthetics.

Most image generators stop when the image looks good. This one keeps going until the image is remembered. Powered by Google Gemini for generation and ResMem (Brain Bridge Lab, University of Chicago) for memorability scoring, it iterates until your image clears a science-validated memorability threshold.


Prerequisites

API Key:

  • GEMINI_API_KEY environment variable, OR
  • --api-key CLI flag, OR
  • ~/.config/gemini/api_key file

Python 3.8+ with these packages:

pip install resmem torch torchvision pillow requests

Quick Start

python scripts/generate_memorable_image.py \
  --prompt "a lone astronaut standing on a red desert planet at dusk" \
  --output hero.png \
  --threshold 0.7 \
  --verbose

How It Works

  1. Generate — Calls the Gemini REST API (gemini-2.0-flash-exp) with your prompt
  2. Score — Runs the image through ResMem to get a memorability score (0–1)
  3. Threshold check — If score ≥ threshold (default: 0.7), saves and returns the image
  4. Regenerate — If below threshold and attempts remain, enhances the prompt with composition cues and tries again
  5. Max attempts — After 3 attempts (default), saves the best result regardless

Each failed attempt appends increasingly strong composition cues to the prompt:

  • Attempt 2: ", striking composition"
  • Attempt 3: ", vivid colors, memorable focal point"

Script Usage

# Basic usage
python scripts/generate_memorable_image.py --prompt "your image description"

# Full options
python scripts/generate_memorable_image.py \
  --prompt "your image description" \
  --output path/to/output.png \
  --threshold 0.75 \
  --max-attempts 3 \
  --api-key YOUR_KEY \
  --verbose

# With verbose scoring output
python scripts/generate_memorable_image.py \
  --prompt "a surreal clock melting over a desert canyon" \
  --verbose

CLI Arguments:

ArgumentDefaultDescription
---------
--prompt(required)Image description
--outputmemorable-image.pngOutput file path
--threshold0.7Memorability threshold (0–1)
--max-attempts3Max regeneration attempts
--api-key(env/file)Gemini API key
--verbose(flag)Show memorability scores per attempt

Prompt Tips for High-Memorability Images

Research shows these compositional elements consistently score higher with ResMem:

  • Faces and eyes — Human faces, especially with direct gaze, are inherently memorable
  • Unusual juxtapositions — Unexpected scale, context, or combination of objects ("a whale floating through a city skyline")
  • Strong focal point — One clear subject against a contrasting background
  • High contrast — Bold color separations between subject and background
  • Emotional resonance — Images that imply narrative or emotion
  • Unusual lighting — Dramatic shadows, golden hour, bioluminescence, neon
  • Unexpected scale — Macro details of normally-seen-large things, or vice versa

Prompts that tend to score low: generic landscapes, symmetrical compositions, neutral palettes, cluttered scenes with no clear focal point.


Memorability Science

> ResMem — Brain Bridge Lab, University of Chicago

> © 2021 The University of Chicago. Non-commercial use license.

> https://github.com/Brain-Bridge-Lab/resmem

>

> ResMem is a deep learning model trained to predict image memorability scores — how likely a person is to remember having seen an image after a brief exposure. Scores range from 0 (instantly forgotten) to 1 (highly memorable).

>

> License: ResMem Non-commercial License — redistribution permitted for non-commercial purposes with attribution. For commercial licensing: wilma@uchicago.edu


Built for Claude Code. Requires a Gemini API key and a local Python environment with resmem installed.

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-07 18:11 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Listing Bridge Free Optimizer

kiwi-phantomworks
免费Amazon Listing优化工具,专为跨境卖家打造。将中文产品信息改写成精致的英文Amazon Listing——标题、五条要点及描述...
★ 0 📥 411

Cn Amazon Listing Auditor

kiwi-phantomworks
为跨境卖家打造的亚马逊Listing诊断工具,自动标记翻译错误、文化偏差、措辞问题和关键词缺失,助力提升欧美买家转化率。
★ 0 📥 472

Blog Image Generator

kiwi-phantomworks
已弃用——已被 memorable‑image‑gen 取代。该技能已被使用科学记忆度评分的 Memorable Image Generator 取代...
★ 0 📥 394