@@ -100,6 +100,8 @@ image
100100</hfoption >
101101<hfoption id =" Kandinsky 3 " >
102102
103+ Kandinsky 3 doesn't require a prior model so you can directly load the [ ` Kandinsky3Pipeline ` ] and pass a prompt to generate an image:
104+
103105``` py
104106from diffusers import Kandinsky3Pipeline
105107import torch
@@ -182,6 +184,20 @@ prior_pipeline = KandinskyPriorPipeline.from_pretrained("kandinsky-community/kan
182184pipeline = KandinskyV22Img2ImgPipeline.from_pretrained(" kandinsky-community/kandinsky-2-2-decoder" , torch_dtype = torch.float16, use_safetensors = True ).to(" cuda" )
183185```
184186
187+ </hfoption >
188+ <hfoption id =" Kandinsky 3 " >
189+
190+ Kandinsky 3 doesn't require a prior model so you can directly load the image-to-image pipeline:
191+
192+ ``` py
193+ from diffusers import Kandinsky3Img2ImgPipeline
194+ from diffusers.utils import load_image
195+ import torch
196+
197+ pipeline = Kandinsky3Img2ImgPipeline.from_pretrained(" kandinsky-community/kandinsky-3" , variant = " fp16" , torch_dtype = torch.float16)
198+ pipeline.enable_model_cpu_offload()
199+ ```
200+
185201</hfoption >
186202</hfoptions >
187203
@@ -243,17 +259,7 @@ make_image_grid([original_image.resize((512, 512)), image.resize((512, 512))], r
243259<hfoption id =" Kandinsky 3 " >
244260
245261``` py
246- from diffusers import Kandinsky3Img2ImgPipeline
247- from diffusers.utils import load_image
248- import torch
249-
250- pipeline = Kandinsky3Img2ImgPipeline.from_pretrained(" kandinsky-community/kandinsky-3" , variant = " fp16" , torch_dtype = torch.float16)
251- pipeline.enable_model_cpu_offload()
252-
253- prompt = " A fantasy landscape, Cinematic lighting"
254- image = load_image(" https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg" )
255-
256- image = pipeline(prompt, image = image, strength = 0.75 , num_inference_steps = 25 ).images[0 ]
262+ image = pipeline(prompt, negative_prompt = negative_prompt, image = image, strength = 0.75 , num_inference_steps = 25 ).images[0 ]
257263image
258264```
259265
0 commit comments