fix indent in example code
Browse files
README.md
CHANGED
|
@@ -25,19 +25,19 @@ from diffusers.utils import export_to_gif
|
|
| 25 |
model_id = "stabilityai/stable-diffusion-xl-base-1.0"
|
| 26 |
adapter = MotionAdapter.from_pretrained("guoyww/animatediff-motion-adapter-sdxl-beta", torch_dtype=torch.float16)
|
| 27 |
scheduler = DDIMScheduler.from_pretrained(
|
| 28 |
-
model_id,
|
| 29 |
-
subfolder="scheduler",
|
| 30 |
-
clip_sample=False,
|
| 31 |
-
timestep_spacing="linspace",
|
| 32 |
-
beta_schedule="linear",
|
| 33 |
-
steps_offset=1,
|
| 34 |
)
|
| 35 |
pipe = AnimateDiffSDXLPipeline.from_pretrained(
|
| 36 |
-
model_id,
|
| 37 |
-
motion_adapter=adapter,
|
| 38 |
-
scheduler=scheduler,
|
| 39 |
-
torch_dtype=torch.float16,
|
| 40 |
-
variant="fp16",
|
| 41 |
).to("cuda")
|
| 42 |
|
| 43 |
# enable memory savings
|
|
@@ -45,13 +45,13 @@ pipe.enable_vae_slicing()
|
|
| 45 |
pipe.enable_vae_tiling()
|
| 46 |
|
| 47 |
result = pipe(
|
| 48 |
-
prompt="a panda surfing in the ocean, realistic, hyperrealism, high quality",
|
| 49 |
-
negative_prompt="low quality, worst quality",
|
| 50 |
-
num_inference_steps=20,
|
| 51 |
-
guidance_scale=8,
|
| 52 |
-
width=1024,
|
| 53 |
-
height=1024,
|
| 54 |
-
num_frames=16,
|
| 55 |
)
|
| 56 |
|
| 57 |
export_to_gif(result.frames[0], "animation.gif")
|
|
|
|
| 25 |
model_id = "stabilityai/stable-diffusion-xl-base-1.0"
|
| 26 |
adapter = MotionAdapter.from_pretrained("guoyww/animatediff-motion-adapter-sdxl-beta", torch_dtype=torch.float16)
|
| 27 |
scheduler = DDIMScheduler.from_pretrained(
|
| 28 |
+
model_id,
|
| 29 |
+
subfolder="scheduler",
|
| 30 |
+
clip_sample=False,
|
| 31 |
+
timestep_spacing="linspace",
|
| 32 |
+
beta_schedule="linear",
|
| 33 |
+
steps_offset=1,
|
| 34 |
)
|
| 35 |
pipe = AnimateDiffSDXLPipeline.from_pretrained(
|
| 36 |
+
model_id,
|
| 37 |
+
motion_adapter=adapter,
|
| 38 |
+
scheduler=scheduler,
|
| 39 |
+
torch_dtype=torch.float16,
|
| 40 |
+
variant="fp16",
|
| 41 |
).to("cuda")
|
| 42 |
|
| 43 |
# enable memory savings
|
|
|
|
| 45 |
pipe.enable_vae_tiling()
|
| 46 |
|
| 47 |
result = pipe(
|
| 48 |
+
prompt="a panda surfing in the ocean, realistic, hyperrealism, high quality",
|
| 49 |
+
negative_prompt="low quality, worst quality",
|
| 50 |
+
num_inference_steps=20,
|
| 51 |
+
guidance_scale=8,
|
| 52 |
+
width=1024,
|
| 53 |
+
height=1024,
|
| 54 |
+
num_frames=16,
|
| 55 |
)
|
| 56 |
|
| 57 |
export_to_gif(result.frames[0], "animation.gif")
|