Spaces:
Running
on
Zero
Running
on
Zero
rm load_example
Browse files- edit_app.py +0 -21
edit_app.py
CHANGED
@@ -55,27 +55,6 @@ def main():
|
|
55 |
else:
|
56 |
pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(model_id, torch_dtype=torch.float, safety_checker=None)
|
57 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
58 |
-
example_image = Image.open("imgs/example.jpg").convert("RGB")
|
59 |
-
|
60 |
-
def load_example(
|
61 |
-
steps: int,
|
62 |
-
randomize_seed: bool,
|
63 |
-
seed: int,
|
64 |
-
randomize_cfg: bool,
|
65 |
-
text_cfg_scale: float,
|
66 |
-
image_cfg_scale: float,
|
67 |
-
):
|
68 |
-
example_instruction = random.choice(example_instructions)
|
69 |
-
return [example_image, example_instruction] + generate(
|
70 |
-
example_image,
|
71 |
-
example_instruction,
|
72 |
-
steps,
|
73 |
-
randomize_seed,
|
74 |
-
seed,
|
75 |
-
randomize_cfg,
|
76 |
-
text_cfg_scale,
|
77 |
-
image_cfg_scale,
|
78 |
-
)
|
79 |
|
80 |
def generate(
|
81 |
input_image: Image.Image,
|
|
|
55 |
else:
|
56 |
pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(model_id, torch_dtype=torch.float, safety_checker=None)
|
57 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
def generate(
|
60 |
input_image: Image.Image,
|