Last active
June 23, 2025 03:20
-
-
Save superskirv/e1792bbcfce3ca5e7816fe605ce3ae19 to your computer and use it in GitHub Desktop.
Civitai Image Highlight Remover: Removes glowing border around images.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Civitai Image Highlight Remover | |
// @namespace https://civitai.com/user/superskirv | |
// @version 0.5.3 | |
// @description Removes border from images and models on Civitai | |
// @author Super.Skirv and Qwen2.5-Coder-32B-Instruct | |
// @match https://civitai.com/* | |
// @icon https://civitai.com/images/android-chrome-192x192.png | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Function to remove class names from frame-decoration div names | |
//Typically found on the front page. | |
function removeStyleBorderColors() { | |
// Define the class pattern to search for | |
const classPattern = /^frame-decoration mantine-/; | |
// Get all div elements | |
const divs = document.querySelectorAll('div'); | |
divs.forEach(div => { | |
// Check if the class attribute matches the pattern | |
if (classPattern.test(div.className)) { | |
// Clear the class attribute | |
div.className = ''; | |
} | |
}); | |
} | |
// Function to remove specific classes from divs | |
//Typically found on the image/movie pages. | |
function removeImageCosmeticWrapper() { | |
// Define the class names to search for | |
const classNamesToRemove = [ | |
"CosmeticWrapper_cssFrame__Lrn6N", | |
"CosmeticWrapper_glow__KJ57U", | |
"CosmeticWrapper_texture__cRC58", | |
"CosmeticLights_green__mLmRu" | |
]; | |
// Get all div elements | |
const divs = document.querySelectorAll('div'); | |
divs.forEach(div => { | |
// Check if the div has any of the classes to remove | |
if (classNamesToRemove.some(className => div.classList.contains(className))) { | |
// Remove each specified class | |
classNamesToRemove.forEach(className => div.classList.remove(className)); | |
} | |
}); | |
} | |
// Run the function on page load | |
window.addEventListener('load', () => { | |
removeStyleBorderColors(); | |
removeImageCosmeticWrapper(); | |
}); | |
// Optionally, you can run the function periodically if the page content changes dynamically | |
setInterval(() => { | |
removeStyleBorderColors(); | |
removeImageCosmeticWrapper(); | |
}, 1000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment