海の日
LoRA盛り盛り。彩度・明るさ・コントラスト・フラット化。
ポスターにしたい感じ。
Settings:
Steps: 10,
Sampler: LCM,
Schedule type: Automatic,
CFG scale: 1.8,
Seed: 1809998530,
Size: 1080x1080,
Model hash: 25784462ba,
Model: queen_duke,
VAE hash: 31eab7e928,
VAE: sdxl_vae.safetensors,
Clip skip: 2,
ADetailer model: face_yolov8n.pt,
ADetailer confidence: 0.3,
ADetailer dilate erode: 4,
ADetailer mask blur: 4,
ADetailer denoising strength: 0.4,
ADetailer inpaint only masked: True,
ADetailer inpaint padding: 32,
ADetailer version: 25.3.0,
Version: v1.10.1,
Lora hashes:
dmd2_sdxl_4step_lora: cd83d19628f5
il_brightness_slider_d1: 672c4e2396fe
il_contrast_slider_d1: ecce501be88e
saturation_illu_v1: 47c1d89071f4
xl_saturation_slider: d9242e500f02
sdxl-bucket_flat: 7adc8d145b52
Model: Queen_Duke
Model_URL: https://civitai.com/models/988461/queen
Created_by: sevora
Creater_URL: https://civitai.com/user/sevora
License1: "fair-ai-public-license-1.0-sd"
License_URL1: https://freedevproject.org/faipl-1.0-sd/
License2: "Illustrious_License"
License_URL2: https://huggingface.co/OnomaAIResearch/Illustrious-xl-early-release-v0
AUP: Stability AI Acceptable Use Policy
AUP_URL: https://stability.ai/use-policy
Model: DMD2 Speed LoRA [SDXL, Pony, Illustrious] dmd2_sdxl_4step_lora
Model_URL: https://huggingface.co/tianweiy/DMD2
License: CC BY-NC-SA 4.0 (Creative Commons Attribution-NonCommercial 4.0 International)
License_URL: https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en
AUP: Stability AI Acceptable Use Policy
AUP_URL: https://stability.ai/use-policy
Created_by: tianweiy
Creater_URL: https://huggingface.co/tianweiy
Model: (IL Slider | Tweaker) Color Temperature, Saturation, Brightness | 色温 亮度 饱和度 (IL/Noob调节滑块)
Model_URL: https://civitai.com/models/1093089?modelVersionId=1227726
Created_by: Akiseki
Creater_URL: https://civitai.com/user/Akiseki
License1: "fair-ai-public-license-1.0-sd"
License_URL1: https://freedevproject.org/faipl-1.0-sd/
License2: "Illustrious_License"
License_URL2: https://huggingface.co/OnomaAIResearch/Illustrious-xl-early-release-v0
AUP: Stability AI Acceptable Use Policy
AUP_URL: https://stability.ai/use-policy
Model: (IL Slider | Tweaker) Color Temperature, Saturation, Brightness | 色温 亮度 饱和度 (IL/Noob调节滑块)
Model_URL: https://civitai.com/models/1093089?modelVersionId=1233024
Created_by: Akiseki
Creater_URL: https://civitai.com/user/Akiseki
License1: "fair-ai-public-license-1.0-sd"
License_URL1: https://freedevproject.org/faipl-1.0-sd/
License2: "Illustrious_License"
License_URL2: https://huggingface.co/OnomaAIResearch/Illustrious-xl-early-release-v0
AUP: Stability AI Acceptable Use Policy
AUP_URL: https://stability.ai/use-policy
Model: Saturation Tweaker
Model_URL: https://civitai.com/models/399825/saturation-tweaker
Created_by: oritatami_neko
Creater_URL: https://civitai.com/user/oritatami_neko
License1: "fair-ai-public-license-1.0-sd"
License_URL1: https://freedevproject.org/faipl-1.0-sd/
License2: "Illustrious_License"
License_URL2: https://huggingface.co/OnomaAIResearch/Illustrious-xl-early-release-v0
AUP: Stability AI Acceptable Use Policy
AUP_URL: https://stability.ai/use-policy
Model: Saturation Control for illustrious, NoobAI
Model_URL: https://civitai.com/models/1334866/saturation-control-for-illustrious-noobai
Created_by: lolkemo
Creater_URL: https://civitai.com/user/lolkemo
License1: "fair-ai-public-license-1.0-sd"
License_URL1: https://freedevproject.org/faipl-1.0-sd/
License2: "Illustrious_License"
License_URL2: https://huggingface.co/OnomaAIResearch/Illustrious-xl-early-release-v0
AUP: Stability AI Acceptable Use Policy
AUP_URL: https://stability.ai/use-policy
Model: sdxl-bucket_flat
Model_URL: https://huggingface.co/2vXpSwA7/iroiro-lora/blob/main/test3/sdxl-bucket_flat.safetensors
Created_by: 2vXpSwA7
Creater_URL: https://huggingface.co/2vXpSwA7
License: "CreativeML_Open RAIL++-M"
License_URL: https://huggingface.co/spaces/CompVis/stable-diffusion-license
AUP: Stability AI Acceptable Use Policy
AUP_URL: https://stability.ai/use-policy
Model: sdxl_vae
Model_URL: https://huggingface.co/stabilityai/sdxl-vae
License: MIT
License_URL: https://opensource.org/license/MIT
Created_by: Stability_AI
Creater_URL: https://huggingface.co/stabilityai
AUP: Stability AI Acceptable Use Policy
AUP_URL: https://stability.ai/use-policy
Model: 4x_NMKD-YandereNeoXL_200k.pth
Model_URL: https://openmodeldb.info/models/4x-NMKD-YandereNeo-XL
License: WTFPL (Do What The Fuck You Want To Public License)
License_URL: https://www.wtfpl.net/
Created_by: Nmkd
Creater_URL: https://openmodeldb.info/users/nmkd
Model: YOLOv8 Detection Model
Model_URL: https://huggingface.co/Bingsu/adetailer
License: Apache license 2.0
License_URL: https://www.apache.org/licenses/LICENSE-2.0
Created_by: Bing-su
Creater_URL: https://huggingface.co/Bingsu
テンプレート:バックスラッシュが\に変わってる
```
<%*
// =============================================================
// ▼▼▼ 編集するのはこの一行だけ ▼▼▼
const subfolderName = "20250721";
// =============================================================
// --- フォルダと拡張子の定義(ここから下は変更不要) ---
const baseImageFolder = "10_image/";
const baseNoteFolder = "20_画像の詳細/";
const imageFolderPath = `${baseImageFolder}${subfolderName}/`;
const noteDestFolder = `${baseNoteFolder}${subfolderName}/`;
const imageExtensions = ['png', 'jpg', 'jpeg', 'gif', 'webp'];
// --- 1. 対象画像の検索 ---
const allFiles = app.vault.getFiles();
const imageFiles = allFiles.filter(file =>
file.path.startsWith(imageFolderPath) && imageExtensions.includes(file.extension)
);
if (imageFiles.length === 0) {
new Notice(`フォルダ「${imageFolderPath}」に対象の画像が見つかりませんでした。`);
return;
}
// --- 2. 出力先フォルダの準備 ---
if (!app.vault.getAbstractFileByPath(noteDestFolder)) {
await app.vault.createFolder(noteDestFolder);
new Notice(`フォルダを作成しました: ${noteDestFolder}`);
}
let createdCount = 0;
let errorCount = 0;
// --- 3. 画像ごとにノートを作成(ループ処理) ---
for (const imageFile of imageFiles) {
try {
const noteTitle = imageFile.basename.slice(6);
const newNotePath = `${noteDestFolder}${noteTitle}`;
// 重複チェック
if (app.vault.getAbstractFileByPath(`${newNotePath}.md`)) {
continue; // 既にノートが存在する場合はスキップ
}
// --- 4. Exif情報の取得 ---
const absoluteImagePath = app.vault.adapter.getFullPath(imageFile.path);
const command = `exiftool -json -G1 -n "${absoluteImagePath}"`;
const jsonOutput = await tp.user.exec(command);
const metadata = JSON.parse(jsonOutput)[0];
const userComment = metadata["ExifIFD:UserComment"] || metadata["RIFF:UserComment"] || metadata["EXIF:UserComment"] || metadata["UserComment"];
if (!userComment) {
console.warn(`警告: ${imageFile.name} からUserCommentが見つかりませんでした。`);
const minimalContent = `---
cover: "![[${imageFile.name}]]"
tags:
date: ${subfolderName}
prompt: ""
negative_prompt: ""
settings: ""
---
![[${imageFile.path}]]
`;
await tp.file.create_new(minimalContent, newNotePath, false);
createdCount++;
continue;
}
// --- 5. プロパティ用にテキストを分割・整形 ---
const negativePromptSeparator = "Negative prompt:";
const settingsSeparator = "Steps:";
const negativePromptIndex = userComment.indexOf(negativePromptSeparator);
const settingsIndex = userComment.indexOf(settingsSeparator);
const propPrompt = userComment.slice(0, negativePromptIndex).replace(/\n/g, ' ').replace(/\s\s+/g, ' ').trim();
const propNegativePrompt = userComment.slice(negativePromptIndex + negativePromptSeparator.length, settingsIndex).replace(/\n/g, ' ').replace(/\s\s+/g, ' ').trim();
const propSettings = userComment.slice(settingsIndex).replace(/\n/g, ' ').replace(/\s\s+/g, ' ').trim();
// --- 6. プロパティ領域(Frontmatter)を作成 ---
const frontmatter = `---
cover: "![[${imageFile.name}]]"
tags:
date: ${subfolderName}
prompt: '${propPrompt}'
negative_prompt: '${propNegativePrompt}'
settings: '${propSettings}'
---
`;
// --- 7. 本文用にテキストを分割・整形 ---
const bodyPrompt = userComment.slice(0, negativePromptIndex).trim();
const bodyNegativePrompt = userComment.slice(negativePromptIndex + negativePromptSeparator.length, settingsIndex).trim();
let bodySettings = userComment.slice(settingsIndex).trim();
let loraHashesBlock = "";
const loraRegex = /Lora hashes: ".*?"/s;
const loraMatch = bodySettings.match(loraRegex);
if (loraMatch) {
loraHashesBlock = loraMatch[0];
bodySettings = bodySettings.replace(loraHashesBlock, "").trim();
}
let settingsArray = bodySettings.split(',').map(s => s.trim().replace(/\n/g, ' ')).filter(s => s);
const linkableKeys = ["Model", "VAE", "ADetailer model", "Hires upscaler", "Refiner"];
// ▼▼▼ ここからが変更箇所 ▼▼▼
const processedSettingsArray = settingsArray.map(item => {
const colonIndex = item.indexOf(':');
if (colonIndex > -1) {
const key = item.slice(0, colonIndex).trim();
let value = item.slice(colonIndex + 1).trim();
if (linkableKeys.includes(key)) {
// 値から [hash] のような部分を正規表現で削除
const linkValue = value.replace(/\s*\[.*?\]\s*$/, '').trim();
return `${key}: [[${linkValue}]]`;
}
}
return item;
});
// ▲▲▲ ここまでが変更箇所 ▲▲▲
let finalSettingsText = processedSettingsArray.join(',\n');
if (loraHashesBlock) {
const loraString = loraHashesBlock.replace(/Lora hashes: "/, "").slice(0, -1);
const loras = loraString.split(',').map(l => l.trim()).filter(l => l);
const loraList = loras.map(lora => {
const parts = lora.split(':');
if (parts.length === 2) {
return `- [[${parts[0].trim()}]]: ${parts[1].trim()}`;
}
return `- ${lora}`;
}).join('\n ');
finalSettingsText += `,\nLora hashes:\n ${loraList}`;
}
// --- 8. 最終的なノート本文を作成 ---
const bodyContent = `![[${imageFile.path}]]
#### Prompt:
\`\`\`
${bodyPrompt}
\`\`\`
#### Negative prompt:
\`\`\`
${bodyNegativePrompt}
\`\`\`
#### Settings:
${finalSettingsText}
`;
// --- 9. 全てを結合してノートを作成 ---
await tp.file.create_new(frontmatter + bodyContent, newNotePath, false);
createdCount++;
} catch (error) {
console.error(`ファイル ${imageFile.name} の処理中にエラーが発生しました:`, error);
errorCount++;
}
}
// --- 10. 完了報告 ---
let noticeMessage = `完了: ${createdCount}個の新しいノートを作成しました。`;
if (errorCount > 0) {
noticeMessage += ` ${errorCount}個のファイルでエラーが発生しました。`;
}
new Notice(noticeMessage);
%>
```
呪文
呪文を見るにはログイン・会員登録が必須です。