zecloud commited on
Commit
cd71a0d
·
verified ·
1 Parent(s): c0f38a5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -5
README.md CHANGED
@@ -10,9 +10,14 @@ from diffusers.utils import export_to_gif
10
 
11
  # Load the motion adapter
12
  adapter = MotionAdapter.from_pretrained("guoyww/animatediff-motion-adapter-v1-5-2", torch_dtype=torch.float16)
13
- # load SD 1.5 based finetuned model
 
14
  model_id = "zecloud/mechas"
15
- pipe = AnimateDiffPipeline.from_pretrained(model_id, motion_adapter=adapter, torch_dtype=torch.float16)
 
 
 
 
16
  scheduler = DDIMScheduler.from_pretrained(
17
  model_id,
18
  subfolder="scheduler",
@@ -23,19 +28,27 @@ scheduler = DDIMScheduler.from_pretrained(
23
  )
24
  pipe.scheduler = scheduler
25
 
26
- # enable memory savings
27
  pipe.enable_vae_slicing()
28
  pipe.enable_model_cpu_offload()
29
 
 
30
  output = pipe(
31
  prompt=(
32
- "half body portrait of man smiling with a mysterious gaze, mecha, science_fiction, city, realistic,mecha, a futuristic eiffel tower in the background "
 
 
 
 
 
33
  ),
34
- negative_prompt="(worst quality, low quality:1.4), (bad_prompt_version2:0.8), EasyNegative, badhandv4, text, name, letters, watermark, two tower",
35
  num_frames=16,
36
  guidance_scale=7.0,
37
  num_inference_steps=32,
38
  generator=torch.Generator("cpu").manual_seed(42),
39
  )
 
 
40
  frames = output.frames[0]
41
  export_to_gif(frames, "animation.gif")
 
 
10
 
11
  # Load the motion adapter
12
  adapter = MotionAdapter.from_pretrained("guoyww/animatediff-motion-adapter-v1-5-2", torch_dtype=torch.float16)
13
+
14
+ # Load SD 1.5 based finetuned model
15
  model_id = "zecloud/mechas"
16
+ pipe = AnimateDiffPipeline.from_pretrained(
17
+ model_id,
18
+ motion_adapter=adapter,
19
+ torch_dtype=torch.float16
20
+ )
21
  scheduler = DDIMScheduler.from_pretrained(
22
  model_id,
23
  subfolder="scheduler",
 
28
  )
29
  pipe.scheduler = scheduler
30
 
31
+ # Enable memory savings
32
  pipe.enable_vae_slicing()
33
  pipe.enable_model_cpu_offload()
34
 
35
+ # Define the input prompts and generate the output
36
  output = pipe(
37
  prompt=(
38
+ "half body portrait of man smiling with a mysterious gaze, mecha, science_fiction, city, realistic,mecha, "
39
+ "a futuristic eiffel tower in the background "
40
+ ),
41
+ negative_prompt=(
42
+ "(worst quality, low quality:1.4), (bad_prompt_version2:0.8), EasyNegative, badhandv4, text, name, letters, "
43
+ "watermark, two tower"
44
  ),
 
45
  num_frames=16,
46
  guidance_scale=7.0,
47
  num_inference_steps=32,
48
  generator=torch.Generator("cpu").manual_seed(42),
49
  )
50
+
51
+ # Extract frames and export to GIF
52
  frames = output.frames[0]
53
  export_to_gif(frames, "animation.gif")
54
+