Instructions to use DeepFloyd/IF-I-M-v1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use DeepFloyd/IF-I-M-v1.0 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("DeepFloyd/IF-I-M-v1.0", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
TypeError: __call__() got an unexpected keyword argument 'image' in Stage 2
I got the following error running stage2 as follows: (created a separate conda environment and installed all the required libraries). Stage 1 worked fine
image = stage_2(
image=image, prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_embeds, generator=generator, output_type="pt"
).images
pt_to_pil(image)[0].save("./if_stage_II.png")
'''
TypeError Traceback (most recent call last)
Cell In[11], line 1
----> 1 image = stage_2(
2 image=image, prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_embeds, generator=generator, output_type="pt"
3 ).images
4 pt_to_pil(image)[0].save("./if_stage_II.png")
File /opt/conda/lib/python3.9/site-packages/torch/utils/_contextlib.py:115, in context_decorator..decorate_context(*args, **kwargs)
112 @functools.wraps(func)
113 def decorate_context(*args, **kwargs):
114 with ctx_factory():
--> 115 return func(*args, **kwargs)
TypeError: call() got an unexpected keyword argument 'image'
use this at the top:
from diffusers.pipelines import IFSuperResolutionPipeline
and then replace your instantiation of the stage II pipeline with that class, eg
stage_2 = IFSuperResolutionPipeline.from_pretrained(model_id, ...)
where ... is the args you were already using for the pipeline.