Code Monkey home page Code Monkey logo

aimages's Introduction

AImages

A script for generating images that contain hidden text.

Blog post and motivation: https://www.factsmachine.ai/p/hidden-in-plain-sight

Setup

Modal

This script is designed to run on Modal GPUs. Before running it, please set up your Modal account from your local machine. Please note that Modal is a commercial product

To run the script, clone this repo to your local machine and install the dependencies:

git clone https://github.com/jlowin/aimages
cd aimages
pip install -r requirements.txt

Running

You'll need to create a control image. For best results, use a PNG of white text on a black background, like this one:

Run the script with Modal, replacing the path and prompt appropriately:

modal run sd_controlnet.py \
    --control-image-path path/to/your/control/image \
    --prompt "a prompt to generate the full image" 

This will save an image on your computer.

Note: the first time you run this script, it will download all the model weights and create a Docker image for you. This can take a few minutes, but only needs to be done once. Subsequent runs should start in less than a minute and take only a few seconds to generate an image.

Options

In addition to the control image and prompt, you can provide many options to control image generation:

Setting Default Notes
--seed Provide an integer seed value to "fix" the model rather than using a random starting point. The seed for every model is always printed to the logs for reference.
--steps 30 The number of model iterations to run.
--n 1 The number of images to generate.
--negative-prompt Generated images will try to "avoid" this description
--guidance-scale 7.5 The strength of the prompt for the Stable Diffusion model. Values between 7-9 are generally recommended; higher values will attempt to represent prompts more literally.
--controlnet-conditioning-scale 1.3 The strength of the ControlNet. Values between 1-2 are effective; higher values make text more visible.
--sd-model Lykon/AbsoluteReality This script automatically downloads a few popular Stable Diffusion weights: runwayml/stable-diffusion-v1-5 (the base SD model), as well as SG161222/Realistic_Vision_V5.1_noVAE, Lykon/AbsoluteReality, and Lykon/DreamShaper. You can choose any of them to adjust the style of your images.

aimages's People

Contributors

jlowin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.