niahere 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/nia +17 -6
- package/package.json +1 -1
- package/skills/nia-image/SKILL.md +5 -5
- package/skills/nia-image/assets/nia-profile.webp +0 -0
- package/skills/nia-image/assets/nia-reference.webp +0 -0
- package/skills/nia-image/scripts/generate_image.py +1 -1
- package/src/commands/init.ts +4 -4
- package/skills/nia-image/assets/nia-profile.jpg +0 -0
- package/skills/nia-image/assets/nia-reference.jpg +0 -0
package/bin/nia
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
if ! command -v bun >/dev/null 2>&1; then
|
|
3
3
|
echo "niahere requires Bun runtime."
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
printf "Install Bun now? (y/n) "
|
|
5
|
+
read -r answer
|
|
6
|
+
if [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
|
|
7
|
+
curl -fsSL https://bun.sh/install | bash
|
|
8
|
+
export BUN_INSTALL="$HOME/.bun"
|
|
9
|
+
export PATH="$BUN_INSTALL/bin:$PATH"
|
|
10
|
+
if ! command -v bun >/dev/null 2>&1; then
|
|
11
|
+
echo "Bun install failed. Install manually: curl -fsSL https://bun.sh/install | bash"
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
14
|
+
echo "Bun installed. Continuing..."
|
|
15
|
+
else
|
|
16
|
+
echo ""
|
|
17
|
+
echo "Install manually: curl -fsSL https://bun.sh/install | bash"
|
|
18
|
+
echo "Then run: nia $*"
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
10
21
|
fi
|
|
11
22
|
exec bun "$(dirname "$0")/../src/cli/index.ts" "$@"
|
package/package.json
CHANGED
|
@@ -22,15 +22,15 @@ Generate photorealistic images of Nia with consistent identity across different
|
|
|
22
22
|
|
|
23
23
|
The script looks for references in this order:
|
|
24
24
|
1. `~/.niahere/images/reference.png` — user's custom reference (takes priority)
|
|
25
|
-
2. `assets/nia-reference.
|
|
25
|
+
2. `assets/nia-reference.webp` — default shipped with niahere
|
|
26
26
|
|
|
27
27
|
| Location | Purpose |
|
|
28
28
|
|----------|---------|
|
|
29
29
|
| `~/.niahere/images/reference.png` | User's reference image |
|
|
30
30
|
| `~/.niahere/images/profile.png` | User's profile picture (for Telegram/Slack) |
|
|
31
31
|
| `~/.niahere/images/` | Output directory for new generations |
|
|
32
|
-
| `assets/nia-reference.
|
|
33
|
-
| `assets/nia-profile.
|
|
32
|
+
| `assets/nia-reference.webp` | Default reference (fallback) |
|
|
33
|
+
| `assets/nia-profile.webp` | Default profile picture (fallback) |
|
|
34
34
|
|
|
35
35
|
## Generation Script
|
|
36
36
|
|
|
@@ -39,7 +39,7 @@ The script looks for references in this order:
|
|
|
39
39
|
### Basic Usage
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
# With reference (default — uses assets/nia-reference.
|
|
42
|
+
# With reference (default — uses assets/nia-reference.webp)
|
|
43
43
|
python3 scripts/generate_image.py --prompt "your prompt here"
|
|
44
44
|
|
|
45
45
|
# Without reference (for creating new base images)
|
|
@@ -58,7 +58,7 @@ python3 scripts/generate_image.py \
|
|
|
58
58
|
| Flag | Default | Description |
|
|
59
59
|
|------|---------|-------------|
|
|
60
60
|
| `--prompt` | Default Nia portrait | Image generation prompt |
|
|
61
|
-
| `--reference` | `assets/nia-reference.
|
|
61
|
+
| `--reference` | `assets/nia-reference.webp` | Reference image for identity |
|
|
62
62
|
| `--no-reference` | false | Generate without reference |
|
|
63
63
|
| `--model` | `gemini-3.1-flash-image-preview` | Gemini model |
|
|
64
64
|
| `--aspect-ratio` | `3:4` | Output ratio |
|
|
Binary file
|
|
Binary file
|
|
@@ -25,7 +25,7 @@ DEFAULT_MODEL = "gemini-3.1-flash-image-preview"
|
|
|
25
25
|
PRO_MODEL = "gemini-3-pro-image-preview"
|
|
26
26
|
BASIC_MODEL = "gemini-2.5-flash-image"
|
|
27
27
|
USER_REFERENCE = str(NIA_HOME / "images" / "reference.png")
|
|
28
|
-
DEFAULT_REFERENCE = str(PROJECT_ROOT / "assets" / "nia-reference.
|
|
28
|
+
DEFAULT_REFERENCE = str(PROJECT_ROOT / "assets" / "nia-reference.webp")
|
|
29
29
|
DEFAULT_OUTPUT = str(NIA_HOME / "images")
|
|
30
30
|
DEFAULT_PROMPT = (
|
|
31
31
|
"Generate a warm, natural portrait matching the reference image. "
|
package/src/commands/init.ts
CHANGED
|
@@ -300,7 +300,7 @@ export async function runInit(): Promise<void> {
|
|
|
300
300
|
const imagesDir = `${home}/images`;
|
|
301
301
|
mkdirSync(imagesDir, { recursive: true });
|
|
302
302
|
const hasUserReference = existsSync(`${imagesDir}/reference.png`);
|
|
303
|
-
const hasDefaultReference = existsSync(`${SKILL_ASSETS_DIR}/nia-reference.
|
|
303
|
+
const hasDefaultReference = existsSync(`${SKILL_ASSETS_DIR}/nia-reference.webp`);
|
|
304
304
|
|
|
305
305
|
if (geminiApiKey && !hasUserReference) {
|
|
306
306
|
const setupVisual = await ask(rl, "\nGenerate a visual identity for your agent? (y/n)", "y");
|
|
@@ -342,10 +342,10 @@ export async function runInit(): Promise<void> {
|
|
|
342
342
|
} else if (hasDefaultReference) {
|
|
343
343
|
// No description — copy defaults
|
|
344
344
|
const { copyFileSync } = await import("fs");
|
|
345
|
-
copyFileSync(`${SKILL_ASSETS_DIR}/nia-reference.
|
|
345
|
+
copyFileSync(`${SKILL_ASSETS_DIR}/nia-reference.webp`, `${imagesDir}/reference.png`);
|
|
346
346
|
console.log(` \u2713 copied default reference image`);
|
|
347
|
-
if (existsSync(`${SKILL_ASSETS_DIR}/nia-profile.
|
|
348
|
-
copyFileSync(`${SKILL_ASSETS_DIR}/nia-profile.
|
|
347
|
+
if (existsSync(`${SKILL_ASSETS_DIR}/nia-profile.webp`)) {
|
|
348
|
+
copyFileSync(`${SKILL_ASSETS_DIR}/nia-profile.webp`, `${imagesDir}/profile.png`);
|
|
349
349
|
console.log(` \u2713 copied default profile picture`);
|
|
350
350
|
}
|
|
351
351
|
}
|
|
Binary file
|
|
Binary file
|