Skip to content

Instantly share code, notes, and snippets.

View Mywk's full-sized avatar

Mywk Mywk

View GitHub Profile
@Mywk
Mywk / cli.js
Created September 14, 2022 08:40 — forked from mattdesl/cli.js
colour palette from text prompt using Stable Diffusion https://twitter.com/mattdesl/status/1569457645182152705
/**
* General-purpose NodeJS CLI/API wrapping the Stable-Diffusion python scripts.
*
* Note that this uses an older fork of stable-diffusion
* with the 'txt2img.py' script, and that script was modified to
* support the --outfile command.
*/
var { spawn, exec } = require("child_process");
var path = require("path");
@Mywk
Mywk / FlowDocumentConverter.cs
Created July 3, 2021 20:58
FlowDocument Converter - To create a bitmap from a RichTextBox document
public class FlowDocumentConverter
{
/// <summary>
/// Converts a FlowDocument to a bitmap you can save or print
/// </summary>
/// <remarks>
/// No longer used
/// </remarks>
/// <param name="document"></param>
@Mywk
Mywk / AcrylicWindow.cs
Last active May 17, 2021 15:25
AcrylicWindow - Extension of MetroWindow with BlurBehind and compatibility with both MahApps and MaterialDesignInXamlToolkit
/// <summary>
/// Extended MetroWindow with BlurBehind and compatibility with both MahApps and MaterialDesignInXamlToolkit
/// </summary>
public class AcrylicWindow : MetroWindow
{
internal enum AccentState
{
ACCENT_DISABLED = 1, // Disabled
ACCENT_ENABLE_GRADIENT = 0, // No idea, it's gray no matter what
ACCENT_ENABLE_TRANSPARENTGRADIENT = 2, // Painted with accent colour