zsxkib / idefics3

Idefics3-8B-Llama3, Answers questions and caption about images

  • Public
  • 1.2K runs
  • Paper
  • License

Input

Output

Run time and cost

This model costs approximately $0.0011 to run on Replicate, or 909 runs per $1, but this varies depending on your inputs. It is also open source and you can run it on your own computer with Docker.

This model runs on Nvidia A40 (Large) GPU hardware. Predictions typically complete within 2 seconds.

Readme

🖼️ Idefics3: Advanced Multimodal AI for Image and Text Analysis 🤖

Replicate

Idefics3 is a powerful multimodal AI model that excels at processing both images and text. Based on the Idefics3-8B-Llama3 architecture by Hugging Face, it offers advanced capabilities for image description, visual question answering, and combined image-text analysis.

🌟 Features

  • Processes both images and text inputs
  • Provides detailed image descriptions
  • Answers questions about visual content
  • Performs in-depth analysis of image-text combinations
  • Supports various image formats (PNG, JPEG, WebP, etc.)

🚀 Usage

Input Parameters

  • image: The input image to analyze (required)
  • text: Your question or prompt about the image (required)
  • assistant_prefix: Set the AI’s perspective (default: “Let’s think step by step.”)
  • decoding_strategy: Choose between “greedy” or “top-p-sampling” (default: “greedy”)
  • temperature: Control AI creativity (0.0 to 5.0, default: 0.4)
  • max_new_tokens: Limit response length (8 to 1024, default: 512)
  • repetition_penalty: Reduce word repetition (0.01 to 5.0, default: 1.2)
  • top_p: Fine-tune text generation (0.01 to 0.99, default: 0.8)

Example

import replicate
output = replicate.run(
    "zsxkib/idefics3:<VERSION>",
    input={
        "image": open("path/to/your/image.jpg", "rb"),
        "text": "What do we see in this image?",
        "assistant_prefix": "Let's think step by step.",
        "decoding_strategy": "top-p-sampling",
        "temperature": 0.4,
        "max_new_tokens": 512,
        "repetition_penalty": 1.2,
        "top_p": 0.8
    }
)
print(output)

💡 Tips

  • Provide both an image and a text prompt for optimal results
  • Experiment with different settings to customize the AI’s response
  • Adjust temperature or top_p for more varied or focused outputs

🙏 Acknowledgements

  • Hugging Face for the original Idefics3-8B-Llama3 model
  • The team behind Llama at Meta AI

Citation

If you use this model in your research or applications, please cite the original Idefics3 and Llama papers:

@misc{idefics,
  author = {Hugo Laurençon and Lucile Saulnier and Léo Tronchon and Stas Bekman and Amanpreet Singh and Anton Lozhkov and Thomas Wang and Siddharth Karamcheti and Alexander M. Rush and Douwe Kiela and Matthieu Cord and Victor Sanh},
  title = {idefics: An Open Reproduction of State-of-the-Art Visual Language Models},
  year = {2023},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/huggingface/idefics}},
}

@misc{touvron2023llama,
      title={Llama 2: Open Foundation and Fine-Tuned Chat Models}, 
      author={Hugo Touvron and Louis Martin and Kevin Stone and Peter Albert and Amjad Almahairi and Yasmine Babaei and Nikolay Bashlykov and Soumya Batra and Prajjwal Bhargava and Shruti Bhosale and Dan Bikel and Lukas Blecher and Cristian Canton Ferrer and Moya Chen and Guillem Cucurull and David Esiobu and Jude Fernandes and Jeremy Fu and Wenyin Fu and Brian Fuller and Cynthia Gao and Vedanuj Goswami and Naman Goyal and Anthony Hartshorn and Saghar Hosseini and Rui Hou and Hakan Inan and Marcin Kardas and Viktor Kerkez and Madian Khabsa and Isabel Kloumann and Artem Korenev and Punit Singh Koura and Marie-Anne Lachaux and Thibaut Lavril and Jenya Lee and Diana Liskovich and Yinghai Lu and Yuning Mao and Xavier Martinet and Todor Mihaylov and Pushkar Mishra and Igor Molybog and Yixin Nie and Andrew Poulton and Jeremy Reizenstein and Rashi Rungta and Kalyan Saladi and Alan Schelten and Ruan Silva and Eric Michael Smith and Ranjan Subramanian and Xiaoqing Ellen Tan and Binh Tang and Ross Taylor and Adina Williams and Jian Xiang Kuan and Puxin Xu and Zheng Yan and Iliyan Zarov and Yuchen Zhang and Angela Fan and Melanie Kambadur and Sharan Narang and Aurelien Rodriguez and Robert Stojnic and Sergey Edunov and Thomas Scialom},
      year={2023},
      eprint={2307.09288},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

License

This model is released under the Apache 2.0 license.

🐦 Connect

Questions or feedback? Follow me on Twitter @zsakib_ and let’s chat!