ostris commited on
Commit
269e1e4
·
verified ·
1 Parent(s): b272c6e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -0
README.md CHANGED
@@ -54,6 +54,32 @@ This LoRA will allow you to inference on the Krea2 Turbo model in the style of a
54
  For inference in Comfy UI you will need this custom node. [ComfyUI-Krea2-Ostris-Edit](https://github.com/ostris/ComfyUI-Krea2-Ostris-Edit) Use the template in that repo with this lora for the effect. No trigger word is needed just image and prompt.
55
 
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  ![ref_009](https://cdn-uploads.huggingface.co/production/uploads/643cb43e6eeb746f5ad81c26/LUWIOTqblW9crkzBRce3S.jpeg)
58
 
59
 
 
54
  For inference in Comfy UI you will need this custom node. [ComfyUI-Krea2-Ostris-Edit](https://github.com/ostris/ComfyUI-Krea2-Ostris-Edit) Use the template in that repo with this lora for the effect. No trigger word is needed just image and prompt.
55
 
56
 
57
+ For diffusers, there is a communiuty pipeline here [ostris/Krea2OstrisEdit](https://huggingface.co/ostris/Krea2OstrisEdit). You can run it like below:
58
+
59
+ ```python
60
+ import torch
61
+ from diffusers import DiffusionPipeline
62
+ from PIL import Image
63
+
64
+ pipe = DiffusionPipeline.from_pretrained(
65
+ "krea/Krea-2-Turbo",
66
+ custom_pipeline="ostris/Krea2OstrisEdit",
67
+ torch_dtype=torch.bfloat16,
68
+ )
69
+ pipe.enable_model_cpu_offload() # or pipe.to("cuda") with ~40+ GB of VRAM
70
+
71
+ # An AI-Toolkit Krea 2 LoRA, e.g. the style reference LoRA
72
+ pipe.load_lora_weights(
73
+ "ostris/krea2_turbo_style_reference", weight_name="krea2_style_reference.safetensors"
74
+ )
75
+
76
+ image = pipe(
77
+ "a white yeti with horns reading a book",
78
+ image=Image.open("style_reference.png"), # one reference image or a list of them
79
+ ).images[0]
80
+ image.save("output.png")
81
+ ```
82
+
83
  ![ref_009](https://cdn-uploads.huggingface.co/production/uploads/643cb43e6eeb746f5ad81c26/LUWIOTqblW9crkzBRce3S.jpeg)
84
 
85