Diffusers Bot
commited on
Upload folder using huggingface_hub
Browse files- main/README.md +9 -9
- main/README_community_scripts.md +1 -1
- main/tiled_upscaling.py +1 -1
main/README.md
CHANGED
|
@@ -421,7 +421,7 @@ import torch
|
|
| 421 |
|
| 422 |
pipe = DiffusionPipeline.from_pretrained(
|
| 423 |
"CompVis/stable-diffusion-v1-4",
|
| 424 |
-
|
| 425 |
torch_dtype=torch.float16,
|
| 426 |
safety_checker=None, # Very important for videos...lots of false positives while interpolating
|
| 427 |
custom_pipeline="interpolate_stable_diffusion",
|
|
@@ -462,7 +462,7 @@ def download_image(url):
|
|
| 462 |
response = requests.get(url)
|
| 463 |
return PIL.Image.open(BytesIO(response.content)).convert("RGB")
|
| 464 |
|
| 465 |
-
pipe = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", custom_pipeline="stable_diffusion_mega", torch_dtype=torch.float16,
|
| 466 |
pipe.to("cuda")
|
| 467 |
pipe.enable_attention_slicing()
|
| 468 |
|
|
@@ -1506,12 +1506,12 @@ scheduler = DDIMScheduler.from_pretrained("stabilityai/stable-diffusion-2-1",
|
|
| 1506 |
|
| 1507 |
pipe = StableDiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1",
|
| 1508 |
custom_pipeline="stable_diffusion_tensorrt_txt2img",
|
| 1509 |
-
|
| 1510 |
torch_dtype=torch.float16,
|
| 1511 |
scheduler=scheduler,)
|
| 1512 |
|
| 1513 |
# re-use cached folder to save ONNX models and TensorRT Engines
|
| 1514 |
-
pipe.set_cached_folder("stabilityai/stable-diffusion-2-1",
|
| 1515 |
|
| 1516 |
pipe = pipe.to("cuda")
|
| 1517 |
|
|
@@ -1568,7 +1568,7 @@ text_encoder = CLIPTextModel.from_pretrained(
|
|
| 1568 |
pipeline = DiffusionPipeline.from_pretrained(
|
| 1569 |
pretrained_model_name_or_path="CompVis/stable-diffusion-v1-4",
|
| 1570 |
custom_pipeline="edict_pipeline",
|
| 1571 |
-
|
| 1572 |
scheduler=scheduler,
|
| 1573 |
text_encoder=text_encoder,
|
| 1574 |
leapfrog_steps=True,
|
|
@@ -1660,12 +1660,12 @@ scheduler = DDIMScheduler.from_pretrained("stabilityai/stable-diffusion-2-1",
|
|
| 1660 |
|
| 1661 |
pipe = StableDiffusionImg2ImgPipeline.from_pretrained("stabilityai/stable-diffusion-2-1",
|
| 1662 |
custom_pipeline="stable_diffusion_tensorrt_img2img",
|
| 1663 |
-
|
| 1664 |
torch_dtype=torch.float16,
|
| 1665 |
scheduler=scheduler,)
|
| 1666 |
|
| 1667 |
# re-use cached folder to save ONNX models and TensorRT Engines
|
| 1668 |
-
pipe.set_cached_folder("stabilityai/stable-diffusion-2-1",
|
| 1669 |
|
| 1670 |
pipe = pipe.to("cuda")
|
| 1671 |
|
|
@@ -2251,13 +2251,13 @@ scheduler = PNDMScheduler.from_pretrained("stabilityai/stable-diffusion-2-inpain
|
|
| 2251 |
|
| 2252 |
pipe = StableDiffusionInpaintPipeline.from_pretrained("stabilityai/stable-diffusion-2-inpainting",
|
| 2253 |
custom_pipeline="stable_diffusion_tensorrt_inpaint",
|
| 2254 |
-
|
| 2255 |
torch_dtype=torch.float16,
|
| 2256 |
scheduler=scheduler,
|
| 2257 |
)
|
| 2258 |
|
| 2259 |
# re-use cached folder to save ONNX models and TensorRT Engines
|
| 2260 |
-
pipe.set_cached_folder("stabilityai/stable-diffusion-2-inpainting",
|
| 2261 |
|
| 2262 |
pipe = pipe.to("cuda")
|
| 2263 |
|
|
|
|
| 421 |
|
| 422 |
pipe = DiffusionPipeline.from_pretrained(
|
| 423 |
"CompVis/stable-diffusion-v1-4",
|
| 424 |
+
variant='fp16',
|
| 425 |
torch_dtype=torch.float16,
|
| 426 |
safety_checker=None, # Very important for videos...lots of false positives while interpolating
|
| 427 |
custom_pipeline="interpolate_stable_diffusion",
|
|
|
|
| 462 |
response = requests.get(url)
|
| 463 |
return PIL.Image.open(BytesIO(response.content)).convert("RGB")
|
| 464 |
|
| 465 |
+
pipe = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", custom_pipeline="stable_diffusion_mega", torch_dtype=torch.float16, variant="fp16")
|
| 466 |
pipe.to("cuda")
|
| 467 |
pipe.enable_attention_slicing()
|
| 468 |
|
|
|
|
| 1506 |
|
| 1507 |
pipe = StableDiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1",
|
| 1508 |
custom_pipeline="stable_diffusion_tensorrt_txt2img",
|
| 1509 |
+
variant='fp16',
|
| 1510 |
torch_dtype=torch.float16,
|
| 1511 |
scheduler=scheduler,)
|
| 1512 |
|
| 1513 |
# re-use cached folder to save ONNX models and TensorRT Engines
|
| 1514 |
+
pipe.set_cached_folder("stabilityai/stable-diffusion-2-1", variant='fp16',)
|
| 1515 |
|
| 1516 |
pipe = pipe.to("cuda")
|
| 1517 |
|
|
|
|
| 1568 |
pipeline = DiffusionPipeline.from_pretrained(
|
| 1569 |
pretrained_model_name_or_path="CompVis/stable-diffusion-v1-4",
|
| 1570 |
custom_pipeline="edict_pipeline",
|
| 1571 |
+
variant="fp16",
|
| 1572 |
scheduler=scheduler,
|
| 1573 |
text_encoder=text_encoder,
|
| 1574 |
leapfrog_steps=True,
|
|
|
|
| 1660 |
|
| 1661 |
pipe = StableDiffusionImg2ImgPipeline.from_pretrained("stabilityai/stable-diffusion-2-1",
|
| 1662 |
custom_pipeline="stable_diffusion_tensorrt_img2img",
|
| 1663 |
+
variant='fp16',
|
| 1664 |
torch_dtype=torch.float16,
|
| 1665 |
scheduler=scheduler,)
|
| 1666 |
|
| 1667 |
# re-use cached folder to save ONNX models and TensorRT Engines
|
| 1668 |
+
pipe.set_cached_folder("stabilityai/stable-diffusion-2-1", variant='fp16',)
|
| 1669 |
|
| 1670 |
pipe = pipe.to("cuda")
|
| 1671 |
|
|
|
|
| 2251 |
|
| 2252 |
pipe = StableDiffusionInpaintPipeline.from_pretrained("stabilityai/stable-diffusion-2-inpainting",
|
| 2253 |
custom_pipeline="stable_diffusion_tensorrt_inpaint",
|
| 2254 |
+
variant='fp16',
|
| 2255 |
torch_dtype=torch.float16,
|
| 2256 |
scheduler=scheduler,
|
| 2257 |
)
|
| 2258 |
|
| 2259 |
# re-use cached folder to save ONNX models and TensorRT Engines
|
| 2260 |
+
pipe.set_cached_folder("stabilityai/stable-diffusion-2-inpainting", variant='fp16',)
|
| 2261 |
|
| 2262 |
pipe = pipe.to("cuda")
|
| 2263 |
|
main/README_community_scripts.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# Community Scripts
|
| 2 |
|
| 3 |
-
**Community scripts** consist of inference examples using Diffusers pipelines that have been added by the community.
|
| 4 |
Please have a look at the following table to get an overview of all community examples. Click on the **Code Example** to get a copy-and-paste code example that you can try out.
|
| 5 |
If a community script doesn't work as expected, please open an issue and ping the author on it.
|
| 6 |
|
|
|
|
| 1 |
# Community Scripts
|
| 2 |
|
| 3 |
+
**Community scripts** consist of inference examples using Diffusers pipelines that have been added by the community.
|
| 4 |
Please have a look at the following table to get an overview of all community examples. Click on the **Code Example** to get a copy-and-paste code example that you can try out.
|
| 5 |
If a community script doesn't work as expected, please open an issue and ping the author on it.
|
| 6 |
|
main/tiled_upscaling.py
CHANGED
|
@@ -282,7 +282,7 @@ class StableDiffusionTiledUpscalePipeline(StableDiffusionUpscalePipeline):
|
|
| 282 |
def main():
|
| 283 |
# Run a demo
|
| 284 |
model_id = "stabilityai/stable-diffusion-x4-upscaler"
|
| 285 |
-
pipe = StableDiffusionTiledUpscalePipeline.from_pretrained(model_id,
|
| 286 |
pipe = pipe.to("cuda")
|
| 287 |
image = Image.open("../../docs/source/imgs/diffusers_library.jpg")
|
| 288 |
|
|
|
|
| 282 |
def main():
|
| 283 |
# Run a demo
|
| 284 |
model_id = "stabilityai/stable-diffusion-x4-upscaler"
|
| 285 |
+
pipe = StableDiffusionTiledUpscalePipeline.from_pretrained(model_id, variant="fp16", torch_dtype=torch.float16)
|
| 286 |
pipe = pipe.to("cuda")
|
| 287 |
image = Image.open("../../docs/source/imgs/diffusers_library.jpg")
|
| 288 |
|