/*
Copyright 2022 juenbug12851
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* @file
* @brief Legacy v1 dynamic-prompt generator (#anime-irl-v1): a frozen, monolithic version of the scene, kept for reproducibility. See notes/reference/dynamic-prompts.md.
*/
// This was taken from publicprompts.art and modified to be more dynamic
import _ from "lodash";
function maybeAddColor() {
if (_.random(0.0, 1.0, true) < 0.5) return "{color} ";
else return "";
}
// Closeup face portrait of a <name>, smooth soft skin, big dreamy eyes, beautiful intricate colored hair, symmetrical, anime wide eyes, soft lighting, detailed face, by makoto shinkai, stanley artgerm lau, wlop, rossdraws, concept art, digital painting, looking into camera
/**
* Generate the `#anime-irl-v1` dynamic-prompt fragment. See notes/reference/dynamic-prompts.md.
* @param {object} settings The settings.
* @param {object} imageSettings The imageSettings.
* @param {object} upscaleSettings The upscaleSettings.
* @returns {string} The generated prompt fragment.
*/
export default function (settings, imageSettings, upscaleSettings) {
// Start with base prompt
let prompt = `Closeup face portrait of a`;
switch (_.random(0, 1, false)) {
case 0:
prompt += ` {d/character}`;
break;
case 1:
prompt += ` person`;
break;
}
if (_.random(0.0, 1.0, true) < 0.5) prompt += ", {emotion}";
if (_.random(0.0, 1.0, true) < 0.5) prompt += `, ${maybeAddColor()}{hair}`;
const clothingCount = _.random(0.0, 1.0, true) < 0.5 ? _.random(0, 5, false) : 0;
for (let i = 0; i < clothingCount; i++) {
prompt += `, ${maybeAddColor()}{clothes}`;
}
const adjectiveCount = _.random(0.0, 1.0, true) < 0.5 ? _.random(0, 3, false) : 0;
for (let i = 0; i < adjectiveCount; i++) {
prompt += ", {adjective}";
}
const nounCount = _.random(0.0, 1.0, true) < 0.5 ? _.random(0, 3, false) : 0;
for (let i = 0; i < nounCount; i++) {
prompt += ", {noun}";
}
if (_.random(0.0, 1.0, true) < 0.5) prompt += ", {verb}";
if (_.random(0.0, 1.0, true) < 0.5) prompt += ", {time}";
if (_.random(0.0, 1.0, true) < 0.5) prompt += ", {weather}";
if (_.random(0.0, 1.0, true) < 0.2) prompt += ", {instrument}";
if (_.random(0.0, 1.0, true) < 0.5) prompt += ", <rays>";
prompt += `, smooth soft skin, big dreamy eyes, beautiful intricate colored hair, symmetrical, anime wide eyes, soft lighting, detailed face, by makoto shinkai, stanley artgerm lau, wlop, rossdraws, concept art, digital painting, looking into camera`;
return prompt;
}