chenyangqi commited on
Commit
acac4ca
1 Parent(s): 6aa163b

annotate=False, add default prompt

Browse files
FateZero/config/low_resource_teaser/jeep_watercolor_ddim_10_steps.yaml CHANGED
@@ -24,6 +24,7 @@ validation_sample_logger_config:
24
  # a silver jeep driving down a curvy road in the countryside,
25
  watercolor painting of a silver jeep driving down a curvy road in the countryside,
26
  ]
 
27
  p2p_config:
28
  0:
29
  # Whether to directly copy the cross attention from source
 
24
  # a silver jeep driving down a curvy road in the countryside,
25
  watercolor painting of a silver jeep driving down a curvy road in the countryside,
26
  ]
27
+ annotate: False
28
  p2p_config:
29
  0:
30
  # Whether to directly copy the cross attention from source
FateZero/video_diffusion/pipelines/p2pvalidation_loop.py CHANGED
@@ -79,9 +79,15 @@ class p2pSampleLogger:
79
  # handle input image
80
  if image is not None:
81
  input_pil_images = pipeline.numpy_to_pil(tensor_to_numpy(image))[0]
82
- samples_all.append([
83
- annotate_image(image, "input sequence", font_size=self.annotate_size) for image in input_pil_images
84
- ])
 
 
 
 
 
 
85
  for idx, prompt in enumerate(tqdm(self.prompts, desc="Generating sample images")):
86
  if self.prompt2prompt_edit:
87
  if self.traverse_p2p_config:
@@ -135,6 +141,10 @@ class p2pSampleLogger:
135
  images = [
136
  annotate_image(image, prompt, font_size=self.annotate_size) for image in sequence
137
  ]
 
 
 
 
138
 
139
  if self.make_grid:
140
  samples_all.append(images)
 
79
  # handle input image
80
  if image is not None:
81
  input_pil_images = pipeline.numpy_to_pil(tensor_to_numpy(image))[0]
82
+ if self.annotate:
83
+ samples_all.append([
84
+ annotate_image(image, "input sequence", font_size=self.annotate_size) for image in input_pil_images
85
+ ])
86
+ else:
87
+ samples_all.append([
88
+ image for image in input_pil_images
89
+ ])
90
+
91
  for idx, prompt in enumerate(tqdm(self.prompts, desc="Generating sample images")):
92
  if self.prompt2prompt_edit:
93
  if self.traverse_p2p_config:
 
141
  images = [
142
  annotate_image(image, prompt, font_size=self.annotate_size) for image in sequence
143
  ]
144
+ else:
145
+ images = [
146
+ image for image in sequence
147
+ ]
148
 
149
  if self.make_grid:
150
  samples_all.append(images)
app_fatezero.py CHANGED
@@ -68,10 +68,12 @@ with gr.Blocks(css='style.css') as demo:
68
 
69
  source_prompt = gr.Textbox(label='Source Prompt',
70
  max_lines=1,
71
- placeholder='Example: "a silver jeep driving down a curvy road in the countryside"')
 
72
  target_prompt = gr.Textbox(label='Target Prompt',
73
  max_lines=1,
74
- placeholder='Example: "watercolor painting of a silver jeep driving down a curvy road in the countryside"')
 
75
 
76
  cross_replace_steps = gr.Slider(label='cross-attention replace steps',
77
  minimum=0.0,
@@ -87,7 +89,8 @@ with gr.Blocks(css='style.css') as demo:
87
 
88
  enhance_words = gr.Textbox(label='words to be enhanced',
89
  max_lines=1,
90
- placeholder='Example: "watercolor "')
 
91
 
92
  enhance_words_value = gr.Slider(label='Amplify the target cross-attention',
93
  minimum=0.0,
@@ -96,12 +99,12 @@ with gr.Blocks(css='style.css') as demo:
96
  value=10)
97
 
98
 
99
- with gr.Accordion('DDIM Parameters', open=False):
100
  num_steps = gr.Slider(label='Number of Steps',
101
  minimum=0,
102
- maximum=100,
103
  step=1,
104
- value=50)
105
  guidance_scale = gr.Slider(label='CFG Scale',
106
  minimum=0,
107
  maximum=50,
 
68
 
69
  source_prompt = gr.Textbox(label='Source Prompt',
70
  max_lines=1,
71
+ placeholder='Example: "a silver jeep driving down a curvy road in the countryside"',
72
+ value='a silver jeep driving down a curvy road in the countryside')
73
  target_prompt = gr.Textbox(label='Target Prompt',
74
  max_lines=1,
75
+ placeholder='Example: "watercolor painting of a silver jeep driving down a curvy road in the countryside"',
76
+ value='watercolor painting of a silver jeep driving down a curvy road in the countryside')
77
 
78
  cross_replace_steps = gr.Slider(label='cross-attention replace steps',
79
  minimum=0.0,
 
89
 
90
  enhance_words = gr.Textbox(label='words to be enhanced',
91
  max_lines=1,
92
+ placeholder='Example: "watercolor "',
93
+ value='watercolor')
94
 
95
  enhance_words_value = gr.Slider(label='Amplify the target cross-attention',
96
  minimum=0.0,
 
99
  value=10)
100
 
101
 
102
+ with gr.Accordion('DDIM Parameters', open=True):
103
  num_steps = gr.Slider(label='Number of Steps',
104
  minimum=0,
105
+ maximum=50,
106
  step=1,
107
+ value=10)
108
  guidance_scale = gr.Slider(label='CFG Scale',
109
  minimum=0,
110
  maximum=50,