Skip to content

Commit

Permalink
add more prompts. there are 1048 prompts now
Browse files Browse the repository at this point in the history
  • Loading branch information
gongda authored and gongda committed Apr 18, 2023
1 parent c2f69ca commit 5f00f00
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ An Web UI with intelligent prompts of Stable Diffusion with Core ML on Apple Sil
2. One submit could generate multiple images. Improve your prompt writing speed.
3. Support preserve options of medium and style and artist and resolution.
4. Analysis your usage habits. Help you discover best prompt words.
5. Contains 1048 prompts.


We support [runwayml/stable-diffusion-v1-5](https://huggingface.co/runwayml/stable-diffusion-v1-5) and [stable-diffusion-2-1](https://huggingface.co/stabilityai/stable-diffusion-2-1) now.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,49 @@ Name,Info
hyperrealistic,Increases details and resolution
pop-art,Pop-art style
Modernist,vibrant color and high contrast
art nouveau,Add ornaments and details and building style
art nouveau,Add ornaments and details and building style
Tempera,
Oil Paints,
Acrylic Paints,
Watercolors,
Charcoals,
Pastels,
Chalks,
Graphite Pencils,
Color Pencils,
Ink and Pen,
Digital Paintings,
Vector Art,
3D Renderings,
3D Path Tracing,
3D Ray Tracing,
3D Sculpting,
Matte Paintings,
Digital Matte Paintings,
2D Animation,
Concept Artist,
Fractal Art,
Algorithmic Art,
Data-Moshing,
Dynamic Paintings,
Digital Collage,
2D Digital Paintings,
3D Digital Paintings,
Integrated Arts,
Mixed-Medium Arts,
Raster Paintings,
Miniature,
Diorama,
Terrarium,
Done in LEGO,
Paper Cut Out,
Voxel,
Pixel Art,
Low Poly,
PSX GRAPHICS,
Retro Graphics,
Generative Art,
Play-Doh,
Botanical Drawing,
Technical drawing,
Optical Illusion,
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ let selectAllOptions = function(input_name) {
let checkboxes = $("input[name='" + input_name + "']:checkbox");
console.debug("checkboxes ", checkboxes);
checkboxes.prop('checked', "checked");
};


let openPromptSearchBox = function(input_id) {
let modal = "";
};
3 changes: 3 additions & 0 deletions stable_diffusion_webui/stable_diffusion_webui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def get_prompt_options(file_name):
resolution_options = get_prompt_options("resolution.csv")
light_options = get_prompt_options("lighting.csv")
color_options = get_prompt_options('color.csv')
count_of_options = len(medium_options) + len(style_options) + len(artist_options) + len(website_options) + \
len(resolution_options) + len(light_options) + len(color_options)
print("There are {} prompts".format(count_of_options))


def list_to_matrix(items, col):
Expand Down
8 changes: 4 additions & 4 deletions stable_diffusion_webui/stable_diffusion_webui/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def generate_image(request):
subject, _ = translate_chinese_to_english(subject)
if body['exclude']:
body['exclude'], _ = translate_chinese_to_english(body['exclude'])
combs = generate_combinations(
combs = _generate_combinations(
subject,
body.get('medium', []),
body.get('style', []),
Expand All @@ -109,7 +109,7 @@ def generate_image(request):
)
generate_request = GenerateRequest.objects.create(request_body=body, combinations=combs)

threading.Timer(1, do_generate_image, args=(body, combs, generate_request)).start()
threading.Timer(1, _do_generate_image, args=(body, combs, generate_request)).start()
resp = {
"id": generate_request.id,
"combs": combs
Expand All @@ -118,7 +118,7 @@ def generate_image(request):



def do_generate_image(body, combs, generate_request):
def _do_generate_image(body, combs, generate_request):
model_id = body.get("model_id", "runwayml/stable-diffusion-v1-5") or "runwayml/stable-diffusion-v1-5"
pipe = default_sd_model.get_model(model_id)
generator = torch.Generator("mps").manual_seed(body.get("seed", 0))
Expand Down Expand Up @@ -159,7 +159,7 @@ def do_generate_image(body, combs, generate_request):
return prompts


def generate_combinations(subject, mediums=[], styles=[], artistes=[], websites=[], resolutions=[], colors=[], lightings=[]):
def _generate_combinations(subject, mediums=[], styles=[], artistes=[], websites=[], resolutions=[], colors=[], lightings=[]):
visited = []
queue = []

Expand Down

0 comments on commit 5f00f00

Please sign in to comment.