Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ def query(prompt, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Ka
|
|
21 |
|
22 |
key = random.randint(0, 999)
|
23 |
|
24 |
-
API_TOKEN = random.choice([os.getenv("HF_READ_TOKEN")
|
25 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
26 |
|
27 |
prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
|
@@ -61,7 +61,7 @@ css = """
|
|
61 |
footer {visibility: hidden !important;}
|
62 |
"""
|
63 |
|
64 |
-
with gr.Blocks(theme='Nymbo/
|
65 |
with gr.Tab("Basic Settings"):
|
66 |
with gr.Row():
|
67 |
with gr.Column(elem_id="prompt-container"):
|
@@ -76,63 +76,6 @@ with gr.Blocks(theme='Nymbo/Alyx_Theme') as dalle:
|
|
76 |
strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
|
77 |
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
|
78 |
|
79 |
-
with gr.Tab("Image Editor"):
|
80 |
-
def sleep(im):
|
81 |
-
time.sleep(5)
|
82 |
-
return [im["background"], im["layers"][0], im["layers"][1], im["composite"]]
|
83 |
-
|
84 |
-
def predict(im):
|
85 |
-
return im["composite"]
|
86 |
-
|
87 |
-
with gr.Blocks() as demo:
|
88 |
-
with gr.Row():
|
89 |
-
im = gr.ImageEditor(
|
90 |
-
type="numpy",
|
91 |
-
crop_size="1:1",
|
92 |
-
)
|
93 |
-
|
94 |
-
with gr.Tab("Information"):
|
95 |
-
with gr.Row():
|
96 |
-
gr.Textbox(label="Sample prompt", value="{prompt} | ultra detail, ultra elaboration, ultra quality, perfect.")
|
97 |
-
|
98 |
-
with gr.Accordion("Advanced Settings Overview", open=False):
|
99 |
-
gr.Markdown(
|
100 |
-
""" # `Alyxsissy.com`
|
101 |
-
## Negative Prompt
|
102 |
-
###### This box is for telling the AI what you don't want in your images. Think of it as a way to avoid certain elements. For instance, if you don't want blurry images or extra limbs showing up, this is where you'd mention it.
|
103 |
-
|
104 |
-
## Sampling Steps
|
105 |
-
###### Think of this like the number of brushstrokes in a painting. A higher number can give you a more detailed picture, but it also takes a bit longer. Generally, a middle-ground number like 35 is a good balance between quality and speed.
|
106 |
-
|
107 |
-
## CFG Scale
|
108 |
-
###### CFG stands for "Control Free Guidance." The scale adjusts how closely the AI follows your prompt. A lower number makes the AI more creative and free-flowing, while a higher number makes it stick closely to what you asked for. If you want the AI to take fewer artistic liberties, slide this towards a higher number. Just think "Control Freak Gauge".
|
109 |
-
|
110 |
-
## Sampling Method
|
111 |
-
###### This is the technique the AI uses to create your image. Each option is a different approach, like choosing between pencils, markers, or paint. You don't need to worry too much about this; the default setting is usually the best choice for most users.
|
112 |
-
|
113 |
-
## Strength
|
114 |
-
###### This setting is a bit like the 'intensity' knob. It determines how much the AI modifies the base image it starts with. If you're looking to make subtle changes, keep this low. For more drastic transformations, turn it up.
|
115 |
-
|
116 |
-
## Seed
|
117 |
-
###### You can think of the seed as a 'recipe' for creating an image. If you find a seed that gives you a result you love, you can use it again to create a similar image. If you leave it at -1, the AI will generate a new seed every time.
|
118 |
-
|
119 |
-
|
120 |
-
### Remember, these settings are all about giving you control over the image generation process. Feel free to experiment and see what each one does. And if you're ever in doubt, the default settings are a great place to start. Happy creating!
|
121 |
-
"""
|
122 |
-
)
|
123 |
-
|
124 |
-
with gr.Accordion("Error Codes and What They Mean", open=False):
|
125 |
-
gr.Markdown(
|
126 |
-
""" # `Alyxsissy.com`
|
127 |
-
## Error Codes:
|
128 |
-
#### 500: Error Fetching Model
|
129 |
-
###### This is a temporary error usually caused by a model experiencing high demand, or it is being updated. Try again in a few minutes.
|
130 |
-
|
131 |
-
#### 503: Model is being loaded
|
132 |
-
###### When a particular model hasn't been used for some time, it goes into sleep mode. Error 503 means that the model is being loaded and will be ready within a minute.
|
133 |
-
"""
|
134 |
-
)
|
135 |
-
|
136 |
with gr.Row():
|
137 |
text_button = gr.Button("Run", variant='primary', elem_id="gen-button")
|
138 |
with gr.Row():
|
|
|
21 |
|
22 |
key = random.randint(0, 999)
|
23 |
|
24 |
+
API_TOKEN = random.choice([os.getenv("HF_READ_TOKEN")])
|
25 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
26 |
|
27 |
prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
|
|
|
61 |
footer {visibility: hidden !important;}
|
62 |
"""
|
63 |
|
64 |
+
with gr.Blocks(theme='Nymbo/Nymbo_Theme') as dalle:
|
65 |
with gr.Tab("Basic Settings"):
|
66 |
with gr.Row():
|
67 |
with gr.Column(elem_id="prompt-container"):
|
|
|
76 |
strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
|
77 |
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
with gr.Row():
|
80 |
text_button = gr.Button("Run", variant='primary', elem_id="gen-button")
|
81 |
with gr.Row():
|