MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / main

Function main

diffusers/examples/community/tiled_upscaling.py:282–294  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

280
281
282def 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
289 def callback(obj):
290 print(f"progress: {obj['progress']:.4f}")
291 obj["image"].save("diffusers_library_progress.jpg")
292
293 final_image = pipe(image=image, prompt="Black font, white background, vector", noise_level=40, callback=callback)
294 final_image.save("diffusers_library.jpg")
295
296
297if __name__ == "__main__":

Callers 1

tiled_upscaling.pyFile · 0.70

Calls 2

from_pretrainedMethod · 0.45
toMethod · 0.45

Tested by

no test coverage detected