Below is a template for a JavaScript AI prompt generator that fits your requirements. This program includes functions to randomly select items from lists and assemble them into prompts. It also includes the application of settings and the running of a pipeline with a loop for batch processing. Please adapt and expand the content of the arrays and the assembleString function per your specific needs or domain.
// Function to get a random item from a list
function getRandomItem(list) {
const randomIndex = Math.floor(Math.random() * list.length);
return list[randomIndex];
}
// Variables for pinup artists, costumes, poses, and exotic locales
const pinupArtists = ["Alberto Vargas", "George Petty", "Gil Elvgren", "Earl Moran"];
const pinupCostumes = ["Classic Sailor", "1940s Nurse", "Vintage Cowgirl", "Retro Flight Attendant"];
const pinupPoses = ["Sitting Elegantly", "Classic Lounge", "Playful Wink Pose", "Standing with a Prop"];
const exoticLocales = ["Tropical Beach", "Luxurious Parisian Cafe", "Mysterious Egyptian Ruins", "Enchanted Forest"];
// Assemble the strings using the variables above
function assembleString() {
const artist = getRandomItem(pinupArtists);
const costume = getRandomItem(pinupCostumes);
const pose = getRandomItem(pinupPoses);
const locale = getRandomItem(exoticLocales);
const assembledString = `Create a pinup art by artist ${artist} featuring a ${costume} in a ${pose} at a ${locale}.`;
return assembledString;
}
// Configuration Settings (template, modify as needed)
const configuration = {
// Assuming configuration has more properties that would be initialized here
seed: -1, // Placeholder, will be overwritten in the loop
};
// Negative prompt (modify as per requirements)
const negPrompt = "Avoid using modern technology elements, focus on the authentic vintage look.";
// Example pipeline structure (assumed)
const pipeline = {
run: function({configuration, prompt, negativePrompt}) {
// Placeholder for the pipeline logic
console.log("Running with configuration:", configuration);
console.log("Prompt:", prompt);
console.log("Negative Prompt:", negativePrompt);
// Assume some processing here
}
};
// Batch processing
const batchCount = 5; // Example batch count
for (let i = 0; i < batchCount; i++) {
const randomArtworkDescription = assembleString();
configuration.seed = -1; // or any other logic to change the seed
let batchCountLog = `Rendering ${i+1} of ${batchCount}`;
console.log("Batch Log:", batchCountLog);
pipeline.run({
configuration: configuration,
prompt: randomArtworkDescription,
negativePrompt: negPrompt,
});
}
Please note, this code exemplifies a model based on the description provided. Depending on the actual use case, the pipeline implementation and configuration structure would need corresponding updates. The art generation domain and its specifics, such as artists and costumes, are employed here purely for the sake of illustration.