AlekseyCalvin commited on
Commit
49b4dc1
1 Parent(s): 609045b

Update custom_pipeline.py

Browse files
Files changed (1) hide show
  1. custom_pipeline.py +3 -7
custom_pipeline.py CHANGED
@@ -1,7 +1,7 @@
1
  import torch
2
  import numpy as np
3
- from diffusers import FluxPipeline, FlowMatchEulerDiscreteScheduler
4
- from diffusers.pipelines.flux.pipeline_output import FluxPipelineOutput
5
  from typing import Any, Callable, Dict, List, Optional, Union
6
  from PIL import Image
7
  from diffusers.pipelines.flux.pipeline_flux import calculate_shift, retrieve_timesteps
@@ -55,10 +55,7 @@ def prepare_timesteps(
55
 
56
  # FLUX pipeline function
57
  class FluxWithCFGPipeline(FluxPipeline):
58
- """
59
- Extends the FluxPipeline to yield intermediate images during the denoising process
60
- with progressively increasing resolution for faster generation.
61
- """
62
  @torch.inference_mode()
63
  def generate_images(
64
  self,
@@ -83,7 +80,6 @@ class FluxWithCFGPipeline(FluxPipeline):
83
  joint_attention_kwargs: Optional[Dict[str, Any]] = None,
84
  max_sequence_length: int = 300,
85
  ):
86
- """Generates images and yields intermediate results during the denoising process."""
87
  height = height or self.default_sample_size * self.vae_scale_factor
88
  width = width or self.default_sample_size * self.vae_scale_factor
89
 
 
1
  import torch
2
  import numpy as np
3
+ from diffusers import FlowMatchEulerDiscreteScheduler
4
+ from diffusers.pipelines.flux.pipeline_output import FluxPipeline, FluxPipelineOutput
5
  from typing import Any, Callable, Dict, List, Optional, Union
6
  from PIL import Image
7
  from diffusers.pipelines.flux.pipeline_flux import calculate_shift, retrieve_timesteps
 
55
 
56
  # FLUX pipeline function
57
  class FluxWithCFGPipeline(FluxPipeline):
58
+
 
 
 
59
  @torch.inference_mode()
60
  def generate_images(
61
  self,
 
80
  joint_attention_kwargs: Optional[Dict[str, Any]] = None,
81
  max_sequence_length: int = 300,
82
  ):
 
83
  height = height or self.default_sample_size * self.vae_scale_factor
84
  width = width or self.default_sample_size * self.vae_scale_factor
85