Spaces:
Runtime error
Runtime error
Go Public Version
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- README.md +1 -1
- app.py +106 -84
- images/prerendered/th/BurntCity.png +3 -0
- images/prerendered/th/CONQ_Caustic_Valley.png +3 -0
- images/prerendered/th/CONQ_Frozen_City.png +3 -0
- images/prerendered/th/CONQ_Hellebore_Springs.png +3 -0
- images/prerendered/th/CONQ_Terra_Therma.png +3 -0
- images/prerendered/th/CONQ_Viridian_Bog.png +3 -0
- images/prerendered/th/Firefly_alien_canyons_1.png +3 -0
- images/prerendered/th/Firefly_alien_canyons_2.png +3 -0
- images/prerendered/th/Firefly_alien_dry_canyons_1.png +3 -0
- images/prerendered/th/Firefly_alien_dry_canyons_2.png +3 -0
- images/prerendered/th/Firefly_alien_map_1.png +3 -0
- images/prerendered/th/Firefly_hpg_terrain_1.png +3 -0
- images/prerendered/th/Firefly_hpg_terrain_2.png +3 -0
- images/prerendered/th/Firefly_river_dry_1.png +3 -0
- images/prerendered/th/Firefly_river_running_1.png +3 -0
- images/prerendered/th/Firefly_topographical_alien_desert_1.png +3 -0
- images/prerendered/th/Firefly_topographical_canyon_1.png +3 -0
- images/prerendered/th/Firefly_topographical_height_map_1.png +3 -0
- images/prerendered/th/Firefly_topographical_height_map_2.png +3 -0
- images/prerendered/th/Firefly_topographical_height_map_3.png +3 -0
- images/prerendered/th/Firefly_topographical_height_map_5.png +3 -0
- images/prerendered/th/Firefly_topographical_height_map_6.png +3 -0
- images/prerendered/th/Firefly_topographical_marble_1.png +3 -0
- images/prerendered/th/Firefly_topographical_moon_1.png +3 -0
- images/prerendered/th/Genison.png +3 -0
- images/prerendered/th/Hex_gen_map.PNG +3 -0
- images/prerendered/th/alien_orb_land_1.png +3 -0
- images/prerendered/th/alien_prarie_1.png +3 -0
- images/prerendered/th/alien_world_1.png +3 -0
- images/prerendered/th/alien_world_2.png +3 -0
- images/prerendered/th/alien_world_3.png +3 -0
- images/prerendered/th/alien_world_4.png +3 -0
- images/prerendered/th/alien_world_5.png +3 -0
- images/prerendered/th/canyon_water_1.png +3 -0
- images/prerendered/th/cute3dkawaii.PNG +3 -0
- images/prerendered/th/dark_dirt_elevations_1.png +3 -0
- images/prerendered/th/donald_park.png +3 -0
- images/prerendered/th/elevated_peninsula_1.png +3 -0
- images/prerendered/th/fractal_islands.png +3 -0
- images/prerendered/th/green_farming_alien_world_1.png +3 -0
- images/prerendered/th/green_farming_alien_world_2.png +3 -0
- images/prerendered/th/grey_barren_alien_world_1.png +3 -0
- images/prerendered/th/grey_barren_alien_world_2.png +3 -0
- images/prerendered/th/grey_barren_alien_world_3.png +3 -0
- images/prerendered/th/grey_barren_alien_world_4.png +3 -0
- images/prerendered/th/grey_barren_alien_world_5.png +3 -0
- images/prerendered/th/grey_barren_alien_world_6.png +3 -0
- images/prerendered/th/grey_barren_alien_world_7.png +3 -0
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title: Hex Game Maker
|
| 3 |
emoji: 🌖
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: purple
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Hex Game Maker Development Features
|
| 3 |
emoji: 🌖
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: purple
|
app.py
CHANGED
|
@@ -1,13 +1,10 @@
|
|
| 1 |
import os
|
| 2 |
-
import json
|
| 3 |
-
import copy
|
| 4 |
import time
|
| 5 |
import random
|
| 6 |
import logging
|
| 7 |
from gradio.blocks import postprocess_update_dict
|
| 8 |
import numpy as np
|
| 9 |
from typing import Any, Dict, List, Optional, Union
|
| 10 |
-
import logging
|
| 11 |
|
| 12 |
import torch
|
| 13 |
from PIL import Image
|
|
@@ -42,8 +39,8 @@ from modules.image_utils import (
|
|
| 42 |
open_image,
|
| 43 |
build_prerendered_images_by_quality,
|
| 44 |
upscale_image,
|
| 45 |
-
lerp_imagemath,
|
| 46 |
-
shrink_and_paste_on_blank,
|
| 47 |
show_lut,
|
| 48 |
apply_lut_to_image_path,
|
| 49 |
multiply_and_blend_images,
|
|
@@ -57,24 +54,24 @@ from modules.constants import (
|
|
| 57 |
default_lut_example_img,
|
| 58 |
lut_files,
|
| 59 |
MAX_SEED,
|
| 60 |
-
lut_folder,cards,
|
| 61 |
-
cards_alternating,
|
| 62 |
-
card_colors,
|
| 63 |
-
card_colors_alternating,
|
| 64 |
pre_rendered_maps_paths,
|
| 65 |
PROMPTS,
|
| 66 |
NEGATIVE_PROMPTS,
|
| 67 |
TARGET_SIZE,
|
| 68 |
temp_files
|
| 69 |
)
|
| 70 |
-
from modules.excluded_colors import (
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
)
|
| 78 |
from modules.misc import (
|
| 79 |
get_filename,
|
| 80 |
convert_ratio_to_dimensions,
|
|
@@ -91,6 +88,7 @@ import spaces
|
|
| 91 |
|
| 92 |
input_image_palette = []
|
| 93 |
current_prerendered_image = gr.State("./images/Beeuty-1.png")
|
|
|
|
| 94 |
#---if workspace = local or colab---
|
| 95 |
|
| 96 |
# Authenticate with Hugging Face
|
|
@@ -393,7 +391,7 @@ def generate_image_to_image(prompt_mash, image_input_path, image_strength, steps
|
|
| 393 |
joint_attention_kwargs={"scale": lora_scale},
|
| 394 |
output_type="pil",
|
| 395 |
).images[0]
|
| 396 |
-
return final_image
|
| 397 |
|
| 398 |
@spaces.GPU(duration=140)
|
| 399 |
def run_lora(prompt, image_input, image_strength, cfg_scale, steps, selected_index, randomize_seed, seed, width, height, lora_scale, enlarge, use_conditioned_image=False, progress=gr.Progress(track_tqdm=True)):
|
|
@@ -589,8 +587,8 @@ title = "Hex Game Maker"
|
|
| 589 |
with gr.Blocks(css_paths="style_20250128.css", title=title, theme='Surn/beeuty', delete_cache=(43200, 43200), head_paths="head.htm") as app:
|
| 590 |
with gr.Row():
|
| 591 |
gr.Markdown("""
|
| 592 |
-
# Hex Game Maker
|
| 593 |
-
##
|
| 594 |
with gr.Row():
|
| 595 |
with gr.Accordion("Welcome to Hex Game Maker, the ultimate tool for transforming your images into stunning hexagon grid artworks. Whether you're a tabletop game enthusiast, a digital artist, or someone who loves unique patterns, Hex Game Maker has something for you.", open=False, elem_classes="intro"):
|
| 596 |
gr.Markdown ("""
|
|
@@ -660,35 +658,37 @@ with gr.Blocks(css_paths="style_20250128.css", title=title, theme='Surn/beeuty',
|
|
| 660 |
outputs=[input_image], scroll_to_output=True,
|
| 661 |
)
|
| 662 |
with gr.Column(scale=0):
|
| 663 |
-
|
| 664 |
-
|
| 665 |
-
|
| 666 |
-
|
| 667 |
-
|
| 668 |
-
|
| 669 |
-
|
| 670 |
-
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
|
| 683 |
-
|
| 684 |
-
|
| 685 |
-
|
|
|
|
|
|
|
|
|
|
| 686 |
|
| 687 |
with gr.Accordion("Image Filters", open = False):
|
| 688 |
with gr.Row():
|
| 689 |
with gr.Column():
|
| 690 |
composite_color = gr.ColorPicker(label="Color", value="#ede9ac44")
|
| 691 |
-
with gr.Column():
|
| 692 |
composite_opacity = gr.Slider(label="Opacity %", minimum=0, maximum=100, value=50, interactive=True)
|
| 693 |
with gr.Row():
|
| 694 |
composite_button = gr.Button("Composite", elem_classes="solid")
|
|
@@ -735,8 +735,8 @@ with gr.Blocks(css_paths="style_20250128.css", title=title, theme='Surn/beeuty',
|
|
| 735 |
scroll_to_output=True
|
| 736 |
)
|
| 737 |
with gr.Row():
|
| 738 |
-
with gr.Accordion("Generative AI", open =
|
| 739 |
-
with gr.Column(
|
| 740 |
map_options = gr.Dropdown(
|
| 741 |
label="Map Options",
|
| 742 |
choices=list(PROMPTS.keys()),
|
|
@@ -769,49 +769,66 @@ with gr.Blocks(css_paths="style_20250128.css", title=title, theme='Surn/beeuty',
|
|
| 769 |
inputs=[map_options],
|
| 770 |
outputs=[prompt, negative_prompt_textbox, prompt_notes_label]
|
| 771 |
)
|
| 772 |
-
|
| 773 |
-
with gr.Column(scale=1, elem_id="gen_column"):
|
| 774 |
-
generate_button = gr.Button("Generate From Map Options, Input Image and LoRa Style", variant="primary", elem_id="gen_btn")
|
| 775 |
with gr.Row():
|
| 776 |
-
with gr.Column(scale=
|
| 777 |
-
|
| 778 |
-
|
| 779 |
-
|
| 780 |
-
|
| 781 |
-
|
| 782 |
-
|
| 783 |
-
|
| 784 |
-
|
| 785 |
-
|
|
|
|
|
|
|
| 786 |
with gr.Accordion("Custom LoRA", open=False):
|
| 787 |
with gr.Group():
|
| 788 |
-
custom_lora = gr.Textbox(label="Enter Custom LoRA", placeholder="prithivMLmods/Canopus-LoRA-Flux-Anime")
|
| 789 |
gr.Markdown("[Check the list of FLUX LoRA's](https://huggingface.co/models?other=base_model:adapter:black-forest-labs/FLUX.1-dev)", elem_id="lora_list")
|
| 790 |
custom_lora_info = gr.HTML(visible=False)
|
| 791 |
custom_lora_button = gr.Button("Remove custom LoRA", visible=False)
|
| 792 |
with gr.Column(scale=2):
|
| 793 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 794 |
with gr.Row():
|
| 795 |
with gr.Column(scale=1):
|
| 796 |
# Gallery from PRE_RENDERED_IMAGES GOES HERE
|
| 797 |
-
prerendered_image_gallery = gr.Gallery(label="
|
| 798 |
-
with gr.Column(scale=1):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 799 |
replace_input_image_button = gr.Button(
|
| 800 |
"Replace Input Image",
|
| 801 |
elem_id="prerendered_replace_input_image_button",
|
| 802 |
elem_classes="solid"
|
| 803 |
)
|
| 804 |
-
|
| 805 |
-
|
| 806 |
-
|
| 807 |
-
|
| 808 |
-
|
| 809 |
-
|
| 810 |
with gr.Row():
|
| 811 |
-
image_strength = gr.Slider(label="Image Guidance Strength (prompt percentage)", info="Lower means more image influence", minimum=0.1, maximum=1.0, step=0.01, value=0.
|
| 812 |
with gr.Column():
|
| 813 |
with gr.Row():
|
| 814 |
-
cfg_scale = gr.Slider(label="CFG Scale", minimum=1, maximum=20, step=0.5, value=
|
| 815 |
steps = gr.Slider(label="Steps", minimum=1, maximum=50, step=1, value=30)
|
| 816 |
|
| 817 |
with gr.Row():
|
|
@@ -839,13 +856,18 @@ with gr.Blocks(css_paths="style_20250128.css", title=title, theme='Surn/beeuty',
|
|
| 839 |
outputs=[width]
|
| 840 |
)
|
| 841 |
with gr.Row():
|
| 842 |
-
randomize_seed = gr.Checkbox(
|
| 843 |
-
seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0, randomize=True)
|
| 844 |
lora_scale = gr.Slider(label="LoRA Scale", minimum=0, maximum=3, step=0.01, value=1.01)
|
| 845 |
with gr.Row():
|
| 846 |
gr.HTML(value=getVersions(), visible=True, elem_id="versions")
|
| 847 |
|
| 848 |
# Event Handlers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 849 |
#use conditioned_image as the input_image for generate_input_image_click
|
| 850 |
generate_input_image_from_gallery.click(
|
| 851 |
fn=run_lora,
|
|
@@ -858,17 +880,17 @@ with gr.Blocks(css_paths="style_20250128.css", title=title, theme='Surn/beeuty',
|
|
| 858 |
outputs=gr.State(current_prerendered_image), # Update the state with the selected image
|
| 859 |
show_api=False, scroll_to_output=True
|
| 860 |
)
|
| 861 |
-
|
| 862 |
-
|
| 863 |
-
|
| 864 |
-
|
| 865 |
-
|
| 866 |
-
|
| 867 |
-
|
| 868 |
-
|
| 869 |
-
|
| 870 |
-
|
| 871 |
-
|
| 872 |
# replace input image with selected prerendered image gallery selection
|
| 873 |
replace_input_image_button.click(
|
| 874 |
lambda: current_prerendered_image.value,
|
|
|
|
| 1 |
import os
|
|
|
|
|
|
|
| 2 |
import time
|
| 3 |
import random
|
| 4 |
import logging
|
| 5 |
from gradio.blocks import postprocess_update_dict
|
| 6 |
import numpy as np
|
| 7 |
from typing import Any, Dict, List, Optional, Union
|
|
|
|
| 8 |
|
| 9 |
import torch
|
| 10 |
from PIL import Image
|
|
|
|
| 39 |
open_image,
|
| 40 |
build_prerendered_images_by_quality,
|
| 41 |
upscale_image,
|
| 42 |
+
# lerp_imagemath,
|
| 43 |
+
# shrink_and_paste_on_blank,
|
| 44 |
show_lut,
|
| 45 |
apply_lut_to_image_path,
|
| 46 |
multiply_and_blend_images,
|
|
|
|
| 54 |
default_lut_example_img,
|
| 55 |
lut_files,
|
| 56 |
MAX_SEED,
|
| 57 |
+
# lut_folder,cards,
|
| 58 |
+
# cards_alternating,
|
| 59 |
+
# card_colors,
|
| 60 |
+
# card_colors_alternating,
|
| 61 |
pre_rendered_maps_paths,
|
| 62 |
PROMPTS,
|
| 63 |
NEGATIVE_PROMPTS,
|
| 64 |
TARGET_SIZE,
|
| 65 |
temp_files
|
| 66 |
)
|
| 67 |
+
# from modules.excluded_colors import (
|
| 68 |
+
# add_color,
|
| 69 |
+
# delete_color,
|
| 70 |
+
# build_dataframe,
|
| 71 |
+
# on_input,
|
| 72 |
+
# excluded_color_list,
|
| 73 |
+
# on_color_display_select
|
| 74 |
+
# )
|
| 75 |
from modules.misc import (
|
| 76 |
get_filename,
|
| 77 |
convert_ratio_to_dimensions,
|
|
|
|
| 88 |
|
| 89 |
input_image_palette = []
|
| 90 |
current_prerendered_image = gr.State("./images/Beeuty-1.png")
|
| 91 |
+
|
| 92 |
#---if workspace = local or colab---
|
| 93 |
|
| 94 |
# Authenticate with Hugging Face
|
|
|
|
| 391 |
joint_attention_kwargs={"scale": lora_scale},
|
| 392 |
output_type="pil",
|
| 393 |
).images[0]
|
| 394 |
+
return final_image
|
| 395 |
|
| 396 |
@spaces.GPU(duration=140)
|
| 397 |
def run_lora(prompt, image_input, image_strength, cfg_scale, steps, selected_index, randomize_seed, seed, width, height, lora_scale, enlarge, use_conditioned_image=False, progress=gr.Progress(track_tqdm=True)):
|
|
|
|
| 587 |
with gr.Blocks(css_paths="style_20250128.css", title=title, theme='Surn/beeuty', delete_cache=(43200, 43200), head_paths="head.htm") as app:
|
| 588 |
with gr.Row():
|
| 589 |
gr.Markdown("""
|
| 590 |
+
# Hex Game Maker Development Features
|
| 591 |
+
## This project includes features that did not make it into the main project! ⬢""", elem_classes="intro")
|
| 592 |
with gr.Row():
|
| 593 |
with gr.Accordion("Welcome to Hex Game Maker, the ultimate tool for transforming your images into stunning hexagon grid artworks. Whether you're a tabletop game enthusiast, a digital artist, or someone who loves unique patterns, Hex Game Maker has something for you.", open=False, elem_classes="intro"):
|
| 594 |
gr.Markdown ("""
|
|
|
|
| 658 |
outputs=[input_image], scroll_to_output=True,
|
| 659 |
)
|
| 660 |
with gr.Column(scale=0):
|
| 661 |
+
with gr.Accordion("Sketch Pad (WIP)", open = False):
|
| 662 |
+
with gr.Row():
|
| 663 |
+
sketch_image = gr.Sketchpad(
|
| 664 |
+
label="Sketch Image",
|
| 665 |
+
type="filepath",
|
| 666 |
+
#invert_colors=True,
|
| 667 |
+
#source=['upload','canvas'],
|
| 668 |
+
#tool=['editor','select','color-sketch'],
|
| 669 |
+
placeholder="Draw a sketch or upload an image. Currently broken in gradio 5.17.1",
|
| 670 |
+
interactive=True,
|
| 671 |
+
elem_classes="centered solid imgcontainer",
|
| 672 |
+
key="imgSketch",
|
| 673 |
+
image_mode="RGB",
|
| 674 |
+
format="PNG",
|
| 675 |
+
width=512, # Default width
|
| 676 |
+
height=512 # Default height
|
| 677 |
+
)
|
| 678 |
+
with gr.Row():
|
| 679 |
+
with gr.Column(scale=1):
|
| 680 |
+
sketch_replace_input_image_button = gr.Button(
|
| 681 |
+
"Replace Input Image with sketch",
|
| 682 |
+
elem_id="sketch_replace_input_image_button",
|
| 683 |
+
elem_classes="solid"
|
| 684 |
+
)
|
| 685 |
+
with gr.Column(scale=2):
|
| 686 |
+
alpha_composite_slider = gr.Slider(0,100,50,0.5, label="Alpha Composite Sketch to Input Image", elem_id="alpha_composite_slider")
|
| 687 |
|
| 688 |
with gr.Accordion("Image Filters", open = False):
|
| 689 |
with gr.Row():
|
| 690 |
with gr.Column():
|
| 691 |
composite_color = gr.ColorPicker(label="Color", value="#ede9ac44")
|
|
|
|
| 692 |
composite_opacity = gr.Slider(label="Opacity %", minimum=0, maximum=100, value=50, interactive=True)
|
| 693 |
with gr.Row():
|
| 694 |
composite_button = gr.Button("Composite", elem_classes="solid")
|
|
|
|
| 735 |
scroll_to_output=True
|
| 736 |
)
|
| 737 |
with gr.Row():
|
| 738 |
+
with gr.Accordion("Generative AI", open = True ):
|
| 739 |
+
with gr.Column():
|
| 740 |
map_options = gr.Dropdown(
|
| 741 |
label="Map Options",
|
| 742 |
choices=list(PROMPTS.keys()),
|
|
|
|
| 769 |
inputs=[map_options],
|
| 770 |
outputs=[prompt, negative_prompt_textbox, prompt_notes_label]
|
| 771 |
)
|
|
|
|
|
|
|
|
|
|
| 772 |
with gr.Row():
|
| 773 |
+
with gr.Column(scale=1):
|
| 774 |
+
generate_button = gr.Button("Generate From Map Options, Input Image and LoRa Style", variant="primary", elem_id="gen_btn")
|
| 775 |
+
with gr.Accordion("LoRA Styles", open=False):
|
| 776 |
+
selected_info = gr.Markdown("")
|
| 777 |
+
lora_gallery = gr.Gallery(
|
| 778 |
+
[(item["image"], item["title"]) for item in loras],
|
| 779 |
+
label="LoRA Styles",
|
| 780 |
+
allow_preview=False,
|
| 781 |
+
columns=3,
|
| 782 |
+
elem_id="lora_gallery",
|
| 783 |
+
show_share_button=False
|
| 784 |
+
)
|
| 785 |
with gr.Accordion("Custom LoRA", open=False):
|
| 786 |
with gr.Group():
|
| 787 |
+
custom_lora = gr.Textbox(label="Enter Custom LoRA. **NOT TESTED**", placeholder="prithivMLmods/Canopus-LoRA-Flux-Anime")
|
| 788 |
gr.Markdown("[Check the list of FLUX LoRA's](https://huggingface.co/models?other=base_model:adapter:black-forest-labs/FLUX.1-dev)", elem_id="lora_list")
|
| 789 |
custom_lora_info = gr.HTML(visible=False)
|
| 790 |
custom_lora_button = gr.Button("Remove custom LoRA", visible=False)
|
| 791 |
with gr.Column(scale=2):
|
| 792 |
+
generate_input_image_from_gallery = gr.Button(
|
| 793 |
+
"Generate AI Image from Template Image",
|
| 794 |
+
elem_id="generate_input_image_from_gallery",
|
| 795 |
+
elem_classes="solid",
|
| 796 |
+
variant="primary"
|
| 797 |
+
)
|
| 798 |
+
with gr.Accordion("Template Images", open = False):
|
| 799 |
with gr.Row():
|
| 800 |
with gr.Column(scale=1):
|
| 801 |
# Gallery from PRE_RENDERED_IMAGES GOES HERE
|
| 802 |
+
prerendered_image_gallery = gr.Gallery(label="Template Gallery", show_label=True, value=build_prerendered_images_by_quality(3,'thumbnail'), elem_id="gallery", elem_classes="solid", type="filepath", columns=[3], rows=[3], preview=False ,object_fit="contain", height="auto", format="png",allow_preview=False)
|
| 803 |
+
with gr.Column(scale=1):
|
| 804 |
+
# def handle_login(request: gr.Request):
|
| 805 |
+
# # Extract user information from the request
|
| 806 |
+
# user_info = {
|
| 807 |
+
# "username": request.username,
|
| 808 |
+
# "session_hash": request.session_hash,
|
| 809 |
+
# "headers": dict(request.headers),
|
| 810 |
+
# "client": request.client,
|
| 811 |
+
# "query_params": dict(request.query_params),
|
| 812 |
+
# "path_params": dict(request.path_params)
|
| 813 |
+
# }
|
| 814 |
+
# print(f"\n{user_info}\n")
|
| 815 |
+
# return user_info
|
| 816 |
replace_input_image_button = gr.Button(
|
| 817 |
"Replace Input Image",
|
| 818 |
elem_id="prerendered_replace_input_image_button",
|
| 819 |
elem_classes="solid"
|
| 820 |
)
|
| 821 |
+
# login_button = gr.LoginButton()
|
| 822 |
+
# user_info_output = gr.JSON(label="User Information")
|
| 823 |
+
# login_button.click(fn=handle_login, inputs=[], outputs=user_info_output)
|
| 824 |
+
|
| 825 |
+
with gr.Row():
|
| 826 |
+
with gr.Accordion("Advanced Settings", open=False):
|
| 827 |
with gr.Row():
|
| 828 |
+
image_strength = gr.Slider(label="Image Guidance Strength (prompt percentage)", info="Lower means more image influence", minimum=0.1, maximum=1.0, step=0.01, value=0.9)
|
| 829 |
with gr.Column():
|
| 830 |
with gr.Row():
|
| 831 |
+
cfg_scale = gr.Slider(label="CFG Scale", minimum=1, maximum=20, step=0.5, value=5.0)
|
| 832 |
steps = gr.Slider(label="Steps", minimum=1, maximum=50, step=1, value=30)
|
| 833 |
|
| 834 |
with gr.Row():
|
|
|
|
| 856 |
outputs=[width]
|
| 857 |
)
|
| 858 |
with gr.Row():
|
| 859 |
+
randomize_seed = gr.Checkbox(False, label="Randomize seed",elem_id="rnd_seed_chk")
|
| 860 |
+
seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0, randomize=True, elem_id="rnd_seed")
|
| 861 |
lora_scale = gr.Slider(label="LoRA Scale", minimum=0, maximum=3, step=0.01, value=1.01)
|
| 862 |
with gr.Row():
|
| 863 |
gr.HTML(value=getVersions(), visible=True, elem_id="versions")
|
| 864 |
|
| 865 |
# Event Handlers
|
| 866 |
+
composite_button.click(
|
| 867 |
+
fn=lambda input_image, composite_color, composite_opacity: gr.Warning("Please upload an Input Image to get started.") if input_image is None else change_color(input_image, composite_color, composite_opacity),
|
| 868 |
+
inputs=[input_image, composite_color, composite_opacity],
|
| 869 |
+
outputs=[input_image]
|
| 870 |
+
)
|
| 871 |
#use conditioned_image as the input_image for generate_input_image_click
|
| 872 |
generate_input_image_from_gallery.click(
|
| 873 |
fn=run_lora,
|
|
|
|
| 880 |
outputs=gr.State(current_prerendered_image), # Update the state with the selected image
|
| 881 |
show_api=False, scroll_to_output=True
|
| 882 |
)
|
| 883 |
+
alpha_composite_slider.change(
|
| 884 |
+
fn=alpha_composite_with_control,
|
| 885 |
+
inputs=[input_image, sketch_image, alpha_composite_slider],
|
| 886 |
+
outputs=[input_image],
|
| 887 |
+
scroll_to_output=True
|
| 888 |
+
)
|
| 889 |
+
sketch_replace_input_image_button.click(
|
| 890 |
+
lambda sketch_image: replace_input_with_sketch_image(sketch_image),
|
| 891 |
+
inputs=[sketch_image],
|
| 892 |
+
outputs=[input_image], scroll_to_output=True
|
| 893 |
+
)
|
| 894 |
# replace input image with selected prerendered image gallery selection
|
| 895 |
replace_input_image_button.click(
|
| 896 |
lambda: current_prerendered_image.value,
|
images/prerendered/th/BurntCity.png
ADDED
|
Git LFS Details
|
images/prerendered/th/CONQ_Caustic_Valley.png
ADDED
|
Git LFS Details
|
images/prerendered/th/CONQ_Frozen_City.png
ADDED
|
Git LFS Details
|
images/prerendered/th/CONQ_Hellebore_Springs.png
ADDED
|
Git LFS Details
|
images/prerendered/th/CONQ_Terra_Therma.png
ADDED
|
Git LFS Details
|
images/prerendered/th/CONQ_Viridian_Bog.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_alien_canyons_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_alien_canyons_2.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_alien_dry_canyons_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_alien_dry_canyons_2.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_alien_map_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_hpg_terrain_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_hpg_terrain_2.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_river_dry_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_river_running_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_topographical_alien_desert_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_topographical_canyon_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_topographical_height_map_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_topographical_height_map_2.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_topographical_height_map_3.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_topographical_height_map_5.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_topographical_height_map_6.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_topographical_marble_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Firefly_topographical_moon_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Genison.png
ADDED
|
Git LFS Details
|
images/prerendered/th/Hex_gen_map.PNG
ADDED
|
|
Git LFS Details
|
images/prerendered/th/alien_orb_land_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/alien_prarie_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/alien_world_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/alien_world_2.png
ADDED
|
Git LFS Details
|
images/prerendered/th/alien_world_3.png
ADDED
|
Git LFS Details
|
images/prerendered/th/alien_world_4.png
ADDED
|
Git LFS Details
|
images/prerendered/th/alien_world_5.png
ADDED
|
Git LFS Details
|
images/prerendered/th/canyon_water_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/cute3dkawaii.PNG
ADDED
|
|
Git LFS Details
|
images/prerendered/th/dark_dirt_elevations_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/donald_park.png
ADDED
|
Git LFS Details
|
images/prerendered/th/elevated_peninsula_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/fractal_islands.png
ADDED
|
Git LFS Details
|
images/prerendered/th/green_farming_alien_world_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/green_farming_alien_world_2.png
ADDED
|
Git LFS Details
|
images/prerendered/th/grey_barren_alien_world_1.png
ADDED
|
Git LFS Details
|
images/prerendered/th/grey_barren_alien_world_2.png
ADDED
|
Git LFS Details
|
images/prerendered/th/grey_barren_alien_world_3.png
ADDED
|
Git LFS Details
|
images/prerendered/th/grey_barren_alien_world_4.png
ADDED
|
Git LFS Details
|
images/prerendered/th/grey_barren_alien_world_5.png
ADDED
|
Git LFS Details
|
images/prerendered/th/grey_barren_alien_world_6.png
ADDED
|
Git LFS Details
|
images/prerendered/th/grey_barren_alien_world_7.png
ADDED
|
Git LFS Details
|