Spaces:
Running
Running
update checkpoint
Browse files- README.md +3 -11
- app.py +14 -4
- configs/showo_demo_512x512.yaml +48 -0
README.md
CHANGED
@@ -1,11 +1,3 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
colorFrom: red
|
5 |
-
colorTo: gray
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 4.42.0
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
---
|
11 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:857de79ad7130704e954db56415d8aac249d5341bbf300415ad44825dd8b7a46
|
3 |
+
size 226
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
CHANGED
@@ -16,7 +16,7 @@ from models import Showo, MAGVITv2, get_mask_chedule
|
|
16 |
|
17 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
18 |
|
19 |
-
config = OmegaConf.load("configs/
|
20 |
tokenizer = AutoTokenizer.from_pretrained(config.model.showo.llm_model_path, padding_side="left")
|
21 |
|
22 |
uni_prompting = UniversalPrompting(tokenizer, max_text_len=config.dataset.preprocessing.max_seq_length,
|
@@ -386,9 +386,19 @@ with gr.Blocks() as demo:
|
|
386 |
examples_t2i = gr.Examples(
|
387 |
label="Text to image generation examples",
|
388 |
examples=[
|
389 |
-
"A
|
390 |
-
"
|
391 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
392 |
],
|
393 |
inputs=text_prompt_t2i,
|
394 |
)
|
|
|
16 |
|
17 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
18 |
|
19 |
+
config = OmegaConf.load("configs/showo_demo_512x512.yaml")
|
20 |
tokenizer = AutoTokenizer.from_pretrained(config.model.showo.llm_model_path, padding_side="left")
|
21 |
|
22 |
uni_prompting = UniversalPrompting(tokenizer, max_text_len=config.dataset.preprocessing.max_seq_length,
|
|
|
386 |
examples_t2i = gr.Examples(
|
387 |
label="Text to image generation examples",
|
388 |
examples=[
|
389 |
+
"A 3D render of a futuristic car made of glass, driving through a city of mirrors.",
|
390 |
+
# "A photo-realistic image of a garden with pink and blue flowers. There are pink poppies in the foreground, with their petals gently curved. The background features purple cosmos flowers. The flowers have water droplets on their petals, which glisten in the natural light. The green leaves are lush and healthy. The background is blurred, with a few trees and buildings visible. The overall image has a high resolution and is hyper-realistic, as if taken by a skilled photographer.",
|
391 |
+
"an egg and a bird made of wheat bread.",
|
392 |
+
"An armchair in the shape of an avocado",
|
393 |
+
# "The image features a stylized stained glass illustration of a hummingbird with vibrant colors, set against a backdrop of swirling patterns and a large sun. The composition includes floral elements and intricate details, creating a vivid and dynamic scene that emphasizes the beauty of the bird. The colors range from greens to reds, enhancing the lively and artistic aesthetic of the piece.",
|
394 |
+
# "A 3D render of a surreal explosion scene on the shore of a beautiful white sand beach with crystal clear water. The explosion has a spatter of oil paint with pastel colors and a thick consistency. The explosion is in a quiet and serene environment. A beautiful Japanese woman with a dress compacted to the sea is seen. There are butterfly petals and flowers with an ethereal glow and bioluminescence. There are pink and blue roses, and the overall image has a surreal and dreamlike quality.",
|
395 |
+
# "A 3D render of a cute, round rice ball character with big, sparkling eyes that convey curiosity and joy. Its body is a soft, fluffy white with a slight sheen, resembling freshly cooked rice. Mochi has small, rosy cheeks that give it a warm, friendly expression. A tiny smile brightens its face, and it often sports a colorful ribbon tied around its \"waist,\" adding a playful touch. Mochi's arms and feet are cartoonishly short, allowing it to bounce adorably around its surroundings.",
|
396 |
+
# "A hyper-realistic close-up photograph of a woman's face, focusing on the left side. The image is highly detailed and realistic, showing voluminous glossy lips slightly parted, a well-defined nose, and open eyes with long eyelashes that cast shadows on the skin. The eye color is crystal clear almond green. The skin texture is crisp, with incredible detail of natural, lush skin and pores and freckles, with subtle highlights and shadows that give a realistic, close-up appearance.",
|
397 |
+
"A vibrant cartoon of a chameleon blending into a tie-dye pattern.",
|
398 |
+
"A colorful cartoon of a tiger camouflaged in an abstract art painting, its stripes merging with the wild brushstrokes.",
|
399 |
+
# "A 3D render of a cute, round rice ball character named Mochi, with big, sparkling eyes that convey curiosity and joy. Its body is a soft, fluffy white with a slight sheen, resembling freshly cooked rice. Mochi has small, rosy cheeks that give it a warm, friendly expression. A tiny smile brightens its face, and it often sports a colorful ribbon tied around its \"waist,\" adding a playful touch. Mochi's arms and feet are cartoonishly short, allowing it to bounce adorably around its surroundings. This time, Mochi is placed against a background that is a vibrant explosion of colors, with bright hues of fuchsia, turquoise, lemon yellow, and emerald green creating a canvas of vibrant contrasts and playful energy. The clashing colors make Mochi's soft white body and rosy cheeks stand out even more, inviting viewers into a world of cheerful exuberance and visual delight.",
|
400 |
+
"The word 'mardefly' on a coffee mug.",
|
401 |
+
"A group of seven people standing on a snow-covered slope, allwearing skis and posing for a picture."
|
402 |
],
|
403 |
inputs=text_prompt_t2i,
|
404 |
)
|
configs/showo_demo_512x512.yaml
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
wandb:
|
2 |
+
entity: null
|
3 |
+
# run_id: askkz9i2
|
4 |
+
resume: 'auto'
|
5 |
+
|
6 |
+
experiment:
|
7 |
+
project: "demo"
|
8 |
+
name: "show-o-demo"
|
9 |
+
output_dir: "show-o-demo"
|
10 |
+
|
11 |
+
model:
|
12 |
+
vq_model:
|
13 |
+
type: "magvitv2"
|
14 |
+
vq_model_name: "showlab/magvitv2"
|
15 |
+
|
16 |
+
showo:
|
17 |
+
pretrained_model_path: "showlab/show-o-512x512"
|
18 |
+
w_clip_vit: False
|
19 |
+
vocab_size: 58498
|
20 |
+
llm_vocab_size: 50295
|
21 |
+
llm_model_path: 'microsoft/phi-1_5'
|
22 |
+
codebook_size: 8192
|
23 |
+
num_vq_tokens: 1024
|
24 |
+
num_new_special_tokens: 10 # <|soi|> <|eoi|> <|sov|> <|eov|> <|t2i|> <|mmu|> <|t2v|> <|v2v|> <|lvg|> <|pad|>
|
25 |
+
|
26 |
+
gradient_checkpointing: True
|
27 |
+
|
28 |
+
dataset:
|
29 |
+
gen_type: "t2i"
|
30 |
+
und_type: "captioning"
|
31 |
+
params:
|
32 |
+
batch_size: ${training.batch_size}
|
33 |
+
shuffle_buffer_size: 1000
|
34 |
+
num_workers: 32
|
35 |
+
resolution: 512
|
36 |
+
pin_memory: True
|
37 |
+
persistent_workers: True
|
38 |
+
|
39 |
+
preprocessing:
|
40 |
+
max_seq_length: 128
|
41 |
+
resolution: 512
|
42 |
+
center_crop: False
|
43 |
+
random_flip: False
|
44 |
+
|
45 |
+
training:
|
46 |
+
gradient_accumulation_steps: 1
|
47 |
+
cond_dropout_prob: 0.1
|
48 |
+
batch_size: 20
|