diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 6e5cb79600e70d47a8b0f59d78cb8bf7eadb2571..635f2b522bee8c681617498587d3c282a95be6af 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -173,6 +173,7 @@ App.Data.defaultGameStateVariables = { // Stable Diffusion settings aiApiUrl: "http://localhost:7860", + aiAutoGen: true, aiCfgScale: 5, aiCustomImagePrompts: 0, aiCustomStyleNeg: "", @@ -182,7 +183,7 @@ App.Data.defaultGameStateVariables = { aiSamplingSteps: 20, aiStyle: 1, aiRestoreFaces: true, - aiUpscale: true, + aiUpscale: false, aiUpscaleScale: 1.7, aiUpscaler: "SwinIR_4x", aiWidth: 512, diff --git a/src/002-config/fc-version.js b/src/002-config/fc-version.js index 8a4955f6955d64871b9b1c7fa74b4608fdcf29bc..d6e66c900a0ee0263c82e37302dc01af18131687 100644 --- a/src/002-config/fc-version.js +++ b/src/002-config/fc-version.js @@ -2,5 +2,5 @@ App.Version = { base: "0.10.7.1", // The vanilla version the mod is based off of, this should never be changed. pmod: "4.0.0-alpha.27", commitHash: null, - release: 1213, // When getting close to 2000, please remove the check located within the onLoad() function defined at line five of src/js/eventHandlers.js. + release: 1214, // When getting close to 2000, please remove the check located within the onLoad() function defined at line five of src/js/eventHandlers.js. }; diff --git a/src/art/artJS.js b/src/art/artJS.js index c2facc591c4c637eb0919a93301536867fbe60c7..c381189a6bad0599e3b058488fd217b57410e0e7 100644 --- a/src/art/artJS.js +++ b/src/art/artJS.js @@ -690,7 +690,7 @@ App.Art.aiArtElement = function(slave, imageSize) { }); } - if (slave.custom.aiImageIds === null) { + if (V.aiAutoGen && slave.custom.aiImageIds.length === 0) { updateAndRefresh(); } else { refresh(); diff --git a/src/art/genAI/stableDiffusion.js b/src/art/genAI/stableDiffusion.js index 3e7cd7faf93c70ba397cfee508a2f5c05a768433..17f21fd98dca6dd79ed64e68c9f4ef9b5e423c49 100644 --- a/src/art/genAI/stableDiffusion.js +++ b/src/art/genAI/stableDiffusion.js @@ -61,7 +61,7 @@ App.Art.GenAI.StableDiffusionSettings = class { this.width = width; this.height = height; this.negative_prompt = negative_prompt; - this.restore_faces = restore_faces + this.restore_faces = restore_faces; this.override_strings = override_settings; this.override_settings_restore_afterwards = true; } @@ -254,11 +254,11 @@ App.Art.GenAI.StableDiffusionClient = class { slave.custom.aiImageIds[replacementImageIndex] = imageId; } else { slave.custom.aiImageIds.push(imageId); - slave.custom.aiDisplayImageIdx = slave.custom.aiImageIds.indexOf(imageId) + slave.custom.aiDisplayImageIdx = slave.custom.aiImageIds.indexOf(imageId); } // If image already exists, just update the display idx to it } else { - console.log('generated redundant image, no image stored') + console.log('generated redundant image, no image stored'); slave.custom.aiDisplayImageIdx = imagePreexisting; } } @@ -268,9 +268,9 @@ App.Art.GenAI.StableDiffusionClient = class { * Search slave's existing images for a match with the new image. * @param {FC.SlaveState} slave - The slave we're updating * @param {string} newImageData - new image - * @returns index of the image in aiImageIds or -1 + * @returns {Promise<number>} index of the image in aiImageIds or -1 */ -async function compareExistingImages (slave, newImageData) { +async function compareExistingImages(slave, newImageData) { const aiImages = await Promise.all(slave.custom.aiImageIds.map(id => { return App.Art.GenAI.imageDB.getImage(id); })); @@ -284,7 +284,7 @@ async function compareExistingImages (slave, newImageData) { */ function getImageData(base64Image) { const mimeType = getMimeType(base64Image); - return `data:${mimeType};base64,${base64Image}` + return `data:${mimeType};base64,${base64Image}`; } /** diff --git a/src/events/randomEvent.js b/src/events/randomEvent.js index 03735d8c7f869f1e86f4fe8eca159ab468ef1d83..c0724bbf189ab47d302b65b64c55fcdd04d8830f 100644 --- a/src/events/randomEvent.js +++ b/src/events/randomEvent.js @@ -248,8 +248,9 @@ App.Events.getNonindividualEvents = function() { new App.Events.RENickname().setType("RNIE"), - new App.Events.REMaleCitizenHookup(), new App.Events.RECitizenHookup(), + new App.Events.REMaleCitizenHookup(), + new App.Events.REFemaleArcologyOwner(), new App.Events.REMaleArcologyOwner(), new App.Events.REBoomerang(), new App.Events.REMilfTourist(), @@ -258,7 +259,6 @@ App.Events.getNonindividualEvents = function() { new App.Events.REPokerNight(), new App.Events.TrickShotNight(), new App.Events.REShippingContainer(), - new App.Events.REFemaleArcologyOwner(), new App.Events.REBrothelFunction(), new App.Events.RERebels(), @@ -282,29 +282,33 @@ App.Events.getNonindividualEvents = function() { new App.Events.REBusyServantsQuarters(), new App.Events.REBusyMasterSuite(), - // refs + // FS events + // revivalist artifacts new App.Events.refsAntebellumArtifact(), new App.Events.refsArabianArtifact(), new App.Events.refsAztecArtifact(), - new App.Events.refsBaronDemand(), - new App.Events.refsBodyPurismEncounter(), new App.Events.refsChineseArtifact(), - new App.Events.refsDeadBaron(), - new App.Events.refsDegradationistEncounter(), new App.Events.refsEdoArtifact(), new App.Events.refsEgyptianArtifact(), - new App.Events.refsKnightlyDuel(), + new App.Events.refsRomanArtifact(), + // encounters + new App.Events.refsBodyPurismEncounter(), + new App.Events.refsDegradationistEncounter(), new App.Events.refsMaturityPreferentialistEncounter(), - new App.Events.refsNeoImperialistFeast(), new App.Events.refsPastoralistEncounter(), new App.Events.refsPaternalistEncounter(), new App.Events.refsPhysicalIdealistEncounter(), - new App.Events.refsRomanArtifact(), - new App.Events.refsRomanStoicism(), - new App.Events.refsTotallyLegitCatgirls(), new App.Events.refsTransformationFetishismEncounter(), - new App.Events.refsWarhound(), new App.Events.refsYouthPreferentialistEncounter(), + // neo-imperialism + new App.Events.refsBaronDemand(), + new App.Events.refsDeadBaron(), + new App.Events.refsKnightlyDuel(), + new App.Events.refsNeoImperialistFeast(), + new App.Events.refsWarhound(), + // others + new App.Events.refsRomanStoicism(), + new App.Events.refsTotallyLegitCatgirls(), // FIXME: not actually an FS event... new App.Events.REFSNonconformist(), // Justice Event diff --git a/src/gui/options/options.js b/src/gui/options/options.js index 2d7b21e833c59b1c0687ffbcdf272007a9378a6c..5656e386cf35a2561c2743557892065c5f42b789 100644 --- a/src/gui/options/options.js +++ b/src/gui/options/options.js @@ -1267,6 +1267,9 @@ App.UI.artOptions = function() { options.addCustom(App.UI.DOM.stableDiffusionInstallationGuide("Stable Diffusion Installation Guide")); options.addOption("API URL", "aiApiUrl").showTextBox().addComment("The URL of the Automatic 1111 Stable Diffusion API."); App.UI.aiPromptingOptions(options); + options.addOption("Automatic generation", "aiAutoGen") + .addValue("Enabled", true).on().addValue("Disabled", false).off() + .addComment("Generate images for new slaves on the fly. If disabled, you will need to manually click to generate each slave's image."); options.addOption("Sampling Method", "aiSamplingMethod").showTextBox() .addComment(`The sampling method used by AI. You can query ${V.aiApiUrl}/sdapi/v1/samplers to see the list of available samplers.`); options.addOption("CFG Scale", "aiCfgScale").showTextBox()